My server and php mail() function sends email to the spam folder

Question!

is there any way i install SMTP service on my Linux server and use php to send emails through it ?

so that emails doesn't show up as spam ?

maybe through ssl ?

my mail() function is perfect , with perfect headers , but still sending to spam :(

Thanks .



Answers

You can recheck your headers, maybe there might a space or something in the header from address, you can also check if the ip of your server is blacklisted (http://www.anti-abuse.org/multi-rbl-check/)

By : Joe


There are plenty of variables that could potentially be involved here.

Your idea of a perfect header seems subjective. I would recommend you use something like PHPMailer or Swiftmailer to handle your mailing needs.

Some other variables you might need to take into account are the processing of bounced emails, and making sure you send your mail in chunks as opposed to one big send off.



Cross-posting myself from another answer:

A few bullet points (Assuming that mail() returns true and there are no errors in the error log) :

  • Does the sender address ("From") belong to a domain on your server? If not, make it so.
  • Is your server on a blacklist (e.g. check IP on spamhaus.org)? This is a remote possibility with shared hosting.
  • Are mails filtered by a spam filter? Open an account with a freemailer that has a spam folder and find out. Also, try sending mail to an address without a spam filter.
  • Do you possibly need the fifth parameter "-f" of mail() to add a sender address? (See mail() command in the PHP manual)
  • If you have access to log files, check those, of course, as suggested above.
  • Do you check the "from:" address for possible bounce mails ("Returned to sender")? You can also set up a separate "errors-to" address.
By : Pekka 웃


This video can help you solving your question :)
By: admin

how to send mail when user submit form in php