PHP - Send email from other domain without being spam!

11,309

Solution 1

Send the email from your webserver and add a reply-to header like you have mentioned.

Make sure you have SPF setup for your server to help get yourself into the gMail, Live Mail and Yahoo accounts.

A nice and cheap alternative is to send your emails via Amazon SES to avoid having to warm your own IPs etc.

I would go with the Amazon SES (or a similar service) and leave the worrying about getting the server setup right to the experts. Make ensuring deliverability someone elses problem.

Solution 2

When someone sends an email using php and placing another domain in "from" it will end up in spam.

This is not neccessarily true.

Check which mail servers identify your message as spam. Also check with your hosting company for their preferred method to send out mail.

Try to be straightforward with your message. Offer the users a short textarea (with your default masage), which they can change and customize. Also give the possibility to enter real name of the participants with their e-mail addresses.

Just be senible and your messas will go thru.

Solution 3

This article is a nice starting point:

http://www.codinghorror.com/blog/2010/04/so-youd-like-to-send-some-email-through-code.html

Share:
11,309
tcardoso
Author by

tcardoso

Updated on August 21, 2022

Comments

  • tcardoso
    tcardoso over 1 year

    this was ask over and over and still no good solution!

    When someone sends an email using php and placing another domain in "from" it will end up in spam.

    Solutions normally are: - Use your "from" and place the domain you want in the "reply-to"; - Have your domain whitelisted by main mail services.

    The 1st its not really a solution and I was never able to make 2nd, because its impossible to reach hotmail.com, yahoo.com, etc..

    I see lots of sites today having the option to email article to someone from the user email. How can I achieve this?

    Thx, Telmo Cardoso

    • Álvaro González
      Álvaro González about 13 years
      The language your script is written on has little to do with your messages being considered spam or not. You should clarify whether you're trying to forge the sender address or you are trying to set the real one. And you should also post your code.