Authenticated SMTP

Hello,

My hosting shows me the message:

Emails without SMTP authentication have been detected from your hosting.
In order to better protect your email sending from fraudulent use, this sending mode will soon be blocked, etc.

After checking all my scripts, a few did not have the correct "From" and three domains had no SPF record.

The OVH guide https://docs.ovhcloud.com/fr/guides/web-cloud/web-hosting/mail-function-script-records#en-pratique recommends using PHP's mail() function

The OVH guide https://docs.ovhcloud.com/fr/guides/web-cloud/web-hosting/email-sending-best-practices advises against using PHP's mail() function and recommends using an account with authenticated SMTP via an email account attached to the domain.

Should I conclude that the PHP mail() function cannot send mail via authenticated SMTP and that I must necessarily switch to PHPMailer?

Thanks for clarifying

Hey,

Interesting, and your hypothesis seems correct.
And as a result, the emails sent by the websites will be routed through real mail accounts (mostly at OVH) and will pass through the VadeSecure anti‑spam that OVH uses.

I can understand the move; maintaining the reputation of the SMTP relay IPs is a pain, and bots send spam all over via the forms.
But this will be a very painful undertaking for the customers.

I got the same message.

Indeed, PHP's mail() does not allow sending email after authenticating beforehand.

You need to install PHPMailer or an equivalent, then send your emails by authenticating via an email account previously created on the OVH interface.

That's what I did.

The sender of the email does not necessarily have to be the authentication account, but the domain must be the same.

Furthermore, it is advisable to use SPF and DKIM.

It’s OVH that will add the DKIM signature. However, in case of spoofing, OVH will not add the DKIM signature.

Spoofing is when a sender address is used that is not the authentication one. OVH cannot declare this mail as authentic.

In my case, I add it myself after generating my own certificates.

I’m going to try using PHPMailer and I’m wondering about one point.
The OVH documentation says you need to use an email account attached to the domain; how do you handle subdomains linked to the main account, given that it isn’t possible to create an email address for them via the manager?

OVHcloud does not allow creating email accounts directly for subdomains from the management panel. However, you don’t need to do that.

The solution is to use the email account of your primary domain as the authenticated sender. The From: field must always be this fixed address of the primary domain, never an address of the subdomain.

Could it be that you have multiple threads open? :sweat_smile:

Regards,
Sergio Turpín

Hello
It's hard to be satisfied with this solution; a domain would receive an email from its site with a different sender address, which is not acceptable.
If this is the only solution for now, I'm saying it now because until now I hadn't had this problem, so the multisite offering, without specifying this point, is misleading.