0

We have a problem using PHP mail on a shared hosting server on 1and1.com

We use SPF entries in our TXT DNS settings which include the email servers we use also confirm that outgoing emails are sent from our domain email addresses.

The scenario is: We have a button feature that allows site users to send a personal email from their email address to a client email address.

The problem is: These emails either bounce or end up in SPAM because they do not pass the SPF test.

Although I realize that we can solve the problem with a dedicated server, I was hoping someone had a solution or a way that we could solve the problem and still remain on shared hosting.

Thanks!

scott
  • 79
  • 6
  • 1
    Put their address in reply-to, and one of your addresses as the sender. [Ie, don't actually try to send mail with a from address that you don't control] – Chris Lear Feb 12 '18 at 15:36
  • 1
    I can't see how you would solve this problem with a dedicated server – Chris Lear Feb 12 '18 at 15:38
  • (Because the php mail is not using the same email server as our normal outgoing email. Our normal email server is identified in our SPF settings, but the server sending the PHP mail is not). – scott Feb 12 '18 at 15:38
  • 1
    configure php mail to always connect to your mail server as an outgoing relay. – Chris Lear Feb 12 '18 at 15:40
  • SPF failure has nothing to do with programming, nor does DNS. – Funk Forty Niner Feb 12 '18 at 15:41
  • Have a look at https://stackoverflow.com/questions/14456673/sending-email-with-php-from-an-smtp-server, which will help you if you need to use your smtp server as a relay, assuming it requires authentication. – Chris Lear Feb 12 '18 at 15:45
  • Regrettably using only SPF is no guarantee that your mail will be accepted. It all depends on the receiving mail server, they are all different. Start by looking into DKIM, and then look at the help files of gmail, microsoft, etc, on how they want your mail server to behave. – KIKO Software Feb 12 '18 at 15:46
  • You can't guarantee anything with email, but you can be pretty sure that relaying through your normal mail server from php will behave the same as doing the same thing using a mail client. So that's what to try. – Chris Lear Feb 12 '18 at 15:49
  • Sometimes you have to fill out a form that you are a legit (non spammer) to the some email companies. One example: https://support.microsoft.com/en-us/getsupport?oaspworkflow=start_1.0.0.0&wfname=capsub&productkey=edfsmsbl3&locale=en-us&ccsid=636540481670051678 – Robot70 Feb 12 '18 at 16:04
  • THANK YOU everyone for your excellent feedback and advice. I will implement several of these suggestions and let you know if I succeed... thanks again! – scott Feb 16 '18 at 15:55

0 Answers0