I have two issues to solve .

  1. 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.
  2. 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 .
  • Your Hosting service provider? Sep 27, 2018 at 13:36
  • @samair how did you solve this ? i am also getting email in spam May 31, 2019 at 7:33
  • using smtp , there must be a plugin for that
    – Flutterer
    May 31, 2019 at 20:35

3 Answers 3


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.


System > Configuration > Advanced > System > Mail Sending Settings > Set Return-Path to YES


  • 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.


  • 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.



You can use SMTP module for sending email through Magento. (check Mageplaza SMTP module).

  • i have tried it but maybe it is not compatible with magento 2.2.6
    – Flutterer
    Sep 27, 2018 at 14:04
  • It is compatible with Magento 2.2. You may need the core module of Mageplaza also. Sep 27, 2018 at 14:39
  • @SaurabhDwivedi Mageplaza extension will be work for magento 2.3.1 version ? May 30, 2019 at 15:04
  • @sumeetbajaj, Yes It is working fine in 2.3.1 also. You need add Magplaza core modules also. Jun 1, 2019 at 11:26
  • yes it works,great Jun 1, 2019 at 11:28

One important setting in Magento 1 and 2 regarding spam is setting "Yes" for

System > Configuration > Advanced > System > Mail Sending Settings > Set Return-Path

The name of this setting is a bit misleading: With this setting to "Yes" Magento sets envelope-from of all mails it generates to the configured return address of the specific transactional mail.

With this setting on "No" envelope-from is set by the server and thus header-from != envelop-from. This leads many receiving mail servers to mark the message as spam.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.