简体   繁体   中英

Email goes in spam when I send it via others SMTP server

I'm using PHP Swift_mailer library to send emails to my customers' clients from behalf of customers. I use their SMTP server, port, login, pass:

$transport = Swift_SmtpTransport::newInstance($mail_server['host'], $mail_server['port']);
$transport->setUsername($mail_server['username'])
    ->setPassword($mail_server['password']);

It worked pretty well for a few months, but now the emails started to appear in a Spam folder for some of my customers?

Is it possible that the reason could be at my end (PHP server) or the problem in in my customer's SMTP server?

Thanks in advance!

If you've not done so already, you might want to setup an SPF record for the domain that you are sending from, to indicate that the sending mail server's IP is authorized to send mail for your domain. If you don't already have an SPF record setup, this might solve the problem.

Also - To see if the outgoing SMTP server that you are using has a glaring problem that would cause receiving mail servers to think it's a spammer, try sending a message from your application through your outgoing SMTP server to check-auth@verifier.port25.com. This service will do a bunch of checks, and you'll get a report back with ton of information, such whether or not your mail server's DNS is setup correctly, whether your mail server's IP is on any black lists, if you have a problem with your SPF records, etc.

It's because of your SMTP server. Not the server that runs PHP. The SMTP server is blocked by the destination mail server. For making sure of it, if you change your settings (in PHP code) with Gmail server, it won't go to the spam folder any more.

It worked pretty well for a few months, but now the emails started to appear in a Spam folder for some of my customers?

That's because the destination mail server has added your SMTP server to their blacklist.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM