In the previous article, the www. oschina. netcodesnippet_1182150_25127 attachment function was not written, but it was reserved. PHP source code and demo: source code? Php *** mail sending class ** supports Sending plain text mails and HTML-format
PHP provides a full range of email sending functions. PHP provides a full range of email sending functions. the following functions are powerful for sending emails. can you send html emails or attachments? PhpclassEmail {--- set the full PHP
PearMail sends an email with an attachment. It is easy to add one or more attachments by adding an attachment. you can call the addAttachment method multiple times to add multiple attachemets. Boolean add attachment
Add an attachment
It is easy to
PHP provides a full range of email sending functions. Copy the code as follows :? PhpclassEmail {--- set the global variable var $ mailTo; recipient var $ mailCC; CC var $ mailBCC; secretly CC var $ mailFrom
The code is as follows:
Class Email {/
PHP provides a full range of functions, such as sending emails.
HtmlYou can also send attachments to emails in the specified format.
Class Email {
// --- Set global variables
Var $ mailTo = ""; // recipient
Var $ mailCC = ""; // CC
Var $ mailBCC = "
This type of function is very powerful, not only can send html format emails, but also can send attachments Note: When the author published it, it changed 《《? PhpclassEmail {// --- set the global variable var $ mailTo; // The recipient var $ mailCC;
This type of function is very powerful, not only can send html format emails, but also can send attachments Note: When the author published it, it changed 《《? PhpclassEmail {--- set the global variable var $ mailTo; recipient var $ mailCC; CC var $
Introduction of Phpmailer:Advantages:
Can be run on top of any platform
Support for SMTP authentication
Specify multiple recipients, CC address, send address and reply address when sending mail; Note: Add cc, BCC only under the win
PHP Email: swiftmailer, PHP Mail library--swiftmailerRecently saw a good PHP mail library, like Phpmailer role, but performance than Phpmailer, especially in the ability to handle attachments, send mail success is also high.GitHub Address:
This article describes how to use phpmailer to send emails in thinkphp. if you need PHPMailer, refer to ThinkPHP 2.1 and phpmailer 5.1. (The latter is recommended to be downloaded directly from this blog, because we cannot ensure that the following
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.