<? 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
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
06 Jul 2016
What are some very useful class libraries or tool libraries for PHP?
![Are there PHP libraries to help validate email addresses?](https://img.php.cn/upload/article/001/246/273/173251381914241.jpg)
25 Nov 2024
PHP Libraries for Email Address ValidationValidating email addresses can be a challenging task, especially if you need to adhere to industry...
![Which PHP Library Best Fits Your Email Address Validation Needs?](https://img.php.cn/upload/article/001/246/273/173188824365387.jpg)
18 Nov 2024
PHP Email Address Validation Libraries UncoveredEmail address validation plays a crucial role in data validation, but creating a...
![How Do I Link Static Libraries That Depend on Other Static Libraries?](https://img.php.cn/upload/article/001/246/273/173408941480807.jpg)
13 Dec 2024
Linking Static Libraries to Other Static Libraries: A Comprehensive ApproachStatic libraries provide a convenient mechanism to package reusable...
![PhpMailer vs. SwiftMailer: Which PHP Email Library Reigns Supreme?](https://img.php.cn/upload/article/001/246/273/172925331285343.jpg)
18 Oct 2024
Email Delivery in PHP: PhpMailer vs. SwiftMailerWhen faced with the task of sending emails in PHP, two popular libraries emerge: PhpMailer and SwiftMailer. Choosing the right tool for the job can be crucial, but which one offers a clear advantage?Php
![Why is my HTML email from PHP showing up blank in Gmail with an unwanted 'noname' attachment?](https://img.php.cn/upload/article/001/246/273/173110710393277.jpg)
09 Nov 2024
Troubleshooting HTML Email Sending with PHPYou're encountering issues sending HTML emails from PHP using your provided code. The result is a blank...
![](/static/imghw/down_right.png)
![](/static/imghw/taglogo.png)
Hot Tools
![PHP library for dependency injection containers](https://img.php.cn/upload/manual/000/000/001/5e2171bf3c005481.png)
PHP library for dependency injection containers
PHP library for dependency injection containers
A collection of 50 excellent classic PHP algorithms
Classic PHP algorithm, learn excellent ideas and expand your thinking
Small PHP library for optimizing images
Small PHP library for optimizing images
![](/static/imghw/taglogo.png)