emails are comming to gmail and in spam
-
29-01-2021 - |
Question
I have two issues to solve .
- In
mystore->configuration->sales->order email copy
when i add something@gmail.com email is received (but in spam ). but when i add something@owndomain.co.uk . email is not received not even in spam. - can we solve this spam issue ? I am using Magento 2.2.6 , i already did reply to path on but something is wrong maybe it is not working .
Solution
Magento by default is using built in PHP mail()
function to send e-mails. Commonly some important settings are left at their default values in Magento admin, and are often overlooked or forgotten. By default most people are just configuring default mail sending address in Magento, and stop at that.
This will only set the <from: >
e-mail address in $additional_headers
field for mail() function
. This will indeed put a mail from address in recipients inbox to your mail address but if we inspect the mail headers and server logs actual sending e-mail address will be something like apache@servername.com
. This alone will be reason enough for some spam filters to classify that mail as spam since mail-from and envelope-from will be apache@servername.com
and <from:>
headers will be your configured e-mail address.
In this case I’ve used apache@servername.com
as a “true” senders address but this may vary, depending on how your web server is configured.
Changing
System > Configuration > Advanced > System > Mail Sending Settings > Set Return-Path to YES
REVERSE DNS
- When you’re sending an e-mail from a server inside your domain, make
sure it has its own IP address and its
hostname
is resolved to that IP address.
‘WHITE’ IP ADDRESS
- Sometimes your IP address may become blacklisted, if you lost your
reputation by sending wrong e-mails. After you got a new IP address
from your provider, it’s recommended not to use this address for at
least a month. The reason behind this is that your new IP address
might already be used by someone else before. This 1 month delay lets
the IP address get cleared and became ‘
white
’.
- A good solution is to use SMTP server to send e-mails in
Magento. It can be a public one (such as Gmail, Yahoo and so on, if
you trust them), or your private mail server.
OTHER TIPS
You can use SMTP module for sending email through Magento. (check Mageplaza SMTP module).