How to use PHPMailer
Editor to share with you how to use PHPMailer, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Although php provides the mail () function, it is not easy to use, and PHPMailer is a good email sending tool, and it is very easy to use!
Use PHPMailer to send mail:
The copy code is as follows:
Open my qq email and you can see:
The test went very well:
As can be seen from the above picture, PHPMailer supports sending in html format, and supports sending pictures, attachments! After testing, it is compatible with all kinds of SMTP servers.
Add an attachment if an error is reported:
That's because (set_magic_quotes_runtime ()) has been turned off. And this feature has been completely removed from PHP6.
You can comment or delete the wrong line, or add the @ symbol before set_magic_quotes_runtime ()
Or configuration; error_reporting = E_ALL & ~ E_NOTICE & ~ E_DEPRECATED
The above is all the contents of this article "how to use PHPMailer". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!