Sending e-mails from your site is generally possible. There are – however – a few things to consider.
Since March 15, 2022, there are limits at the outgoing mail servers regarding the e-mail volume of each site. These limits are meant to prevent the abuse of unsecured applications by spammers, or mitigate its impact so that it does not affect the mail utilisation of other users.
The limits are imposed in a way that mails beyond the limit are queued up, until after the passing of a 24-hour period, the quota is restored again. If the daily limit is reached, subsequent mails will be held back until the next day. If your site's mail settings are not properly configured, the daily limit is 50 mails. Please note that one mail is counted per recipient address (To, CC, BCC).
What you need to observe anyway
These steps are neccessary, even if your site only occasionally sends mails. We strongly recommend these settings, since they reduce the risk of your mails being blocked or labelled as spam. The error reports generated by mail server inform you directly about delivery problems.
The most important setting is the sender address (
From header). It must be a valid, working e-mail address. You should be able to actually read the messages sent to this address. Well suited is the e-mail address of the site's functional account configured for forwarding. Do not use addresses from public mail services, or from domains outside of the MWN. Prevent applications or configurations that lead to insertion of arbitrary addresses from user input as
From header. If you do not configure anything, your mail is sent with an automatically generated, invalid sender address. This already causes some mail services to reject your mail right away.
The same address should be used for the
Envelope-from, unless it is another working e-mail address. This
Envelope-from address will receive notifications of problems that occurred during the transport.
Envelope-from address is termed different by different applications: Return-Path, Sender, Envelope Sender, etc. Often, there is an option to use the same address for both sender addresses.
What you need to do to send more e-mails
These steps are neccessary to increase your mail limit.
Your sender addresses (
Envelope-from) must be set as decribed above. If this requirement is met, the limit is automatically set to 250 mails per 24 hours.
You can request a further increase in resonable cases: Create an incident with service 'Webhosting'. Use the variant Selfservice – the one with login. This serves as prove of your permission. The ID of the functional account should be selectable as an option in Affected login. Please also provide the domain name of your site, the sender address that you use, and of course the new limit you want.
Configuration for different use cases
You can use PHP's
mail() function to send e-mails. The
From header can be set using the parameter
Envelope-sender has to be set via
additional_params and "-f absenderadresse" (see "Example #4 Sending mail with an additional command line parameter.").
PHP with framework
if you use a framework, configuration of e-mail parameters should be described in the framework's documentation. Many frameworks use PHPMailer, where the property
$Sender can be set.
... with "WP Mail SMTP"
With the plugin WP Mail SMTP the „Other SMPT“ Mailer can be used and set up properly. Enter your sender address as From Email, und check Force From Email. Also check Set the return-path to match the From Email.
Envelope-from is the main function of the plugin „Stop WP Emails Going to Spam“.