2

Possible 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?

Community
  • 1
  • 1
Gatura
  • 605
  • 2
  • 8
  • 15

3 Answers3

7

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

Vaibs
  • 2,018
  • 22
  • 29
Frodik
  • 14,986
  • 23
  • 90
  • 141
4
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.

dynamic
  • 46,985
  • 55
  • 154
  • 231
2

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
sica07
  • 4,896
  • 8
  • 35
  • 54