Home PHP Libraries Other libraries php attachment email class
php attachment email class
<? 
class CMailFile {  
  
  var $subject;  
  var $addr_to;  
  var $text_body;  
  var $text_encoded;  
  var $mime_headers;  
  var $mime_boundary = "--==================_846811060==_";  
  var $smtp_headers;  
    
  function CMailFile($subject,$to,$from,$msg,$filename,$downfilename,$mimetype = "application/octet-stream",$mime_filename = false) {  
    $this->subject = $subject;     
    $this->addr_to = $to;     
    $this->smtp_headers = $this->write_smtpheaders($from); 
    $this->text_body = $this->write_body($msg); 
    $this->text_encoded = $this->attach_file($filename,$downfilename,$mimetype,$mime_filename); 
    $this->mime_headers = $this->write_mimeheaders($filename, $mime_filename); 
  }  
  
  function attach_file($filename,$downfilename,$mimetype,$mime_filename) { 
    $encoded = $this->encode_file($filename); 
    if ($mime_filename) $filename = $mime_filename; 
    $out = "--" . $this->mime_boundary . "\n"; 
    $out = $out . "Content-type: " . $mimetype . "; name=\"$filename\";\n"; 
    $out = $out . "Content-Transfer-Encoding: base64\n"; 
    $out = $out . "Content-disposition: attachment; filename=

This is a php attachment email class, friends who need it can download and use

Disclaimer

All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn

Related Article

php send email with attachment php send email with attachment

02 Dec 2016

php send email with attachment

Configuration method and parameter description of PHP email docking class Configuration method and parameter description of PHP email docking class

07 Aug 2023

Configuration method and parameter description of PHP email docking class 1. Background introduction With the rapid development of the Internet, email has become an important tool for people to communicate and exchange information. When developing web applications, we often need to use PHP to send emails. In order to facilitate email docking for developers, many excellent PHP email docking libraries have been developed, including PHPMailer, SwiftMailer, etc. This article will focus on the configuration method and parameter description of the PHPMailer class to help

24 useful PHP class libraries to share, 24php class libraries_PHP tutorial 24 useful PHP class libraries to share, 24php class libraries_PHP tutorial

13 Jul 2016

24 useful PHP libraries to share, 24php libraries. 24 useful PHP libraries to share, 24php libraries Currently, PHP is the most popular scripting language used for web development. You can easily find a lot of information about PHP on the Internet, including documentation, tutorials,

How to send email with attachment via php How to send email with attachment via php

11 Jun 2018

emailclass.php<?class CMailFile { var $subject; var $addr_to; var $text_body; var $text_encoded; var $mime_headers; var $mime_boundary = "--==================_846811060==_"; var $s

15 Very Practical Open Source PHP Class Libraries, 15 Open Source Class Libraries_PHP Tutorial 15 Very Practical Open Source PHP Class Libraries, 15 Open Source Class Libraries_PHP Tutorial

13 Jul 2016

15 very practical open source PHP libraries, 15 open source libraries. 15 very practical open source PHP class libraries, 15 open source class libraries The PHP library provides developers with a standard interface, which helps developers make full use of object-oriented programming in PHP. These libraries are specific

Tips and precautions for using PHP email docking class Tips and precautions for using PHP email docking class

07 Aug 2023

Tips and precautions for using the PHP email docking class Email plays an important role in modern society, and the PHP email docking class provides us with a convenient and fast way to send and receive emails. Whether it is website registration verification emails, password retrieval emails, or email marketing and other scenarios, they are all inseparable from the support of email docking. In this article, we will introduce the tips and precautions for using the PHP email docking class, and provide some code examples to help you use it better. 1. Choosing the right email docking PHP has many advantages

See all articles