Link to home
Start Free TrialLog in
Avatar of Nathan Riley
Nathan RileyFlag for United States of America

asked on

PHP and SMTP Sending Email

What's the best method of sending mail while using SMTP credentials?

I have a cron job that checks the database for certain flags if the requirements are met then it will send an email out.  Just sending mail with the normal method in PHP all my mail goes to spam.  I figured if I used smtp credentials it's more likely to be inbox'd?
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

No, that's not true.  Email is a mess and many places are blocking many different things.  If your email is going thru and getting put in spam, you need to get the person receiving it to white list the email address so it gets put in the inbox.
Dave is right.  Even with perfect headers, and a correctly configured mailserver you can still end up in the spam folder if the receiving user is fully locked down, or if at some point the IP you are using got dropped into a blocked list.

The only way to insure your mail ends up in the inbox is if the user whitelists you.

Cd&
Avatar of Nathan Riley

ASKER

Hmm...that will be tough since the users register on the site and then receive email.  

So using SMTP credentials versus regular PHP mail has no benefit then?
No, none.  That does not change the 'user' or IP address that is sending the email which is what the receiver sees.  It is better to send from an email address that does exist so it can be checked by the receiving email server.
Got it, well the mail will be sent from the server that the domain and website reside on as well.  So they will share the same IP address.

Do you have any tips on the correct way to setup headers and such with PHP mail to get a better chance of inboxing?
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
One of the things I do is let the user know that they should check the spam folder if they do not see the confirmation email in their inbox.  I also ask them to whitelist the address in the confirmation email and on the confirmation page.

Cd&
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial