开发者

When setting up PHP mailer who should I set the From address as to avoid spam/blacklisting?

I'm using PHP mailer to as开发者_Go百科 part of an enquiry form that I'm building for a client. One thing I've noticed in testing is that when I use my yahoo account as the FROM and my gmail as the to it works fine for a while but then it starts rejecting, I'm assuming because gmail is smart enough to know that the email isn't actually coming from Yahoo.

What is the best solution to this? I could use the email from the person who has actually filled in the form to show as the FROM address but I'm worried that this may eventually cause the same problem anyway? I could also send it from an email on the domain that its sending from but will that stop it from appearing as spam or black listing that email?

Any help or guidance would be great?


You are getting tagged as a spammer because you are sending the same message over and over. Set up your own mail server without a spam filter while developing if this is a problem.


You are not Yahoo -- don't pretend to be them! Set the From field to an address at the domain that's sending the mail (e.g, if your domain was example.com, send from something like inquiries@example.com or noreply@example.com).


This is probably related to SPF records. mail() will most likely try and send the mail directly to the server(s) identified by the MX record of the recipient domain, and because you are not sending from an IP address that is recognised as one of Yahoo's, Google will reject the email. If you are on *nix, you may be able to configure your system's sendmail program to relay via Yahoo. This is not an option on Windows (I don't think) because Windows has no sendmail and PHP will send the mail itself.

If you want a cross-platform solution you can use something like PEAR::Mail to relay the message through Yahoo's SMTP servers - this should resolve the problem as long as the SPF record is the source of the problem.

If your email is getting flagged as spam because of the content of the message, the only solution is to change the content of the message.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜