Which is the best way to send email using PHP [duplicate]
Possibl开发者_如何学Ce Duplicate:
What is the best practice to send emails from PHP script?
I would like to setup an email application, which is the best method to use in sending emails through PHP and make sure that emails sent through the application is not considered SPAM?
I strongly recommend using some mature PHP class, which solves many problems you would encounter. Such example of a quality PHP mailer library could be PHPMailer
mail();
If you have sendmail configured, otherwise
PHPMailer
Anyway you can't be sure you will not get in the SPAM folder. Just alert your users to check that folder.
There is no way you can be sure your mail won't be considered SPAM. And I would recommend swiftmailer
- Send emails using SMTP, sendmail, postfix or a custom Transport implementation of your own
- Support servers that require username & password and/or encryption
- Protect from header injection attacks without stripping request data content
- Send MIME compliant HTML/multipart emails
- Use event-driven plugins to customize the library
- Handle large attachments and inline/embedded images with low memory use
精彩评论