Monitoring and managing automated emails in your web hosting plan

Find out how to monitor and manage automated emails sent from your OVHcloud web hosting plan

Last updated 12th October 2022

Objective

Automated emails are messages sent via scripts, commonly done with PHP's "mail()" function. For example, they are used for your website’s contact form, allowing your visitors to send you messages.

This guide mainly applies to emails sent from scripts located on your OVHcloud web hosting plan using the PHP "mail()" function.

If you would like to manage the email accounts included in your MX Plan service or in your OVHcloud web hosting plan , please refer to our MX Plan documentation.

Although we strongly recommend using PHP's "mail()" function, you can also send emails from your shared hosting by going through a script using Simple Mail Transfer Protocol (SMTP).

This guide explains how to monitor and manage automated emails sent from your OVHcloud web hosting plan.

Requirements

Instructions

You can monitor and manage automated emails from your OVHcloud web hosting plan in your OVHcloud Control Panel. Once you have logged in, go to the Web Cloud section, open Hosting plans and select the relevant hosting plan from the list. Click on the More tab, then select Email scripts.

hosting

This page enables you to monitor and manage automated emails sent from your OVHcloud web hosting plan.

Overview of the “Email scripts” section

hosting

The page displays several pieces of information that you can use to view automated email activity generated by your scripts:

  • Service status: The current status of the service sending automated emails from your web hosting plan:

    • If it is green ("Enabled" or "Force"), it means that outgoing messages are operational.
    • If it is red (“Disabled”, “Bounce” or “SPAM”), the sending has stopped.

    Depending on this status, the outgoing process will be different.

  • Error report to: This setting allows you to receive a daily report to the email address of your choice. Activate it by clicking the Change the recipient button. The report will include emails sent from your web hosting plan that bounced back with an error at OVHcloud. You can also view these reports at any time via the Emails in error button on the right of the Email scripts page.

  • Total number of emails sent: Refers to the number of automated emails sent since you created your OVHcloud web hosting plan.
  • Emails sent today: The total number of automated emails sent on the current day.
  • Total number of unsent emails: The number of automated emails sent since you created your web hosting plan that returned an error to OVHcloud.
  • Record of sent emails: This graph displays the number of emails sent from your web hosting plan over the previous days.

On the right, there are several buttons you can use to manage automated emails sent from your web hosting plan. Depending on the service status, some options may not be available.

  • Purge emails: Clears the emails in the queue and unblocks the sending of emails.
  • Emails in error: Unblocks the sending of automated emails from your web hosting plan. The emails in the queue will also be resent.
  • Block the sending of emails: Blocks the distribution of automated emails from your web hosting plan. The emails generated by your scripts after the blocking will not be sent, but will be stored in a queue for a maximum of 72 hours.

To perform the desired action, click the corresponding button, then click Confirm. In some cases, the execution may take several minutes to be fully effective.

To avoid unwanted use of automated emails from your web hosting plan, we strongly recommend setting up a security system, such as including a "Captcha" in the forms on your website that can send emails (a contact form, for example).

If you notice that the emails generated from your scripts are no longer sent, but the service status still allows the emails to be sent (“Enabled” or “Force”), we recommend the following checks:

  • Check the scripts sending the email: The scripts may not be able to send the emails due to a syntax error. Check the content of your scripts, correct them if necessary, then try again.

  • Check email sending via test script: Create a test script that sends an email to your personal email address using the following code:

<?php
$to = "RecipientEmail@adress.tld"; 
$subject = "Test mail PHP"; 
$content = "The body/content of the Email";
$headers = "From: Website <SendingEmail@address.tld>\r\nReply-To: SendingEmail@address.tld";

if (mail($to, $subject, $content, $headers))
echo "The email has been sent successfully!";
else
echo "Email did not leave correctly!";
?>

For $headers, enter the same sending email address twice.

If you receive the message The email has been sent successfully! on the email address you have defined in the line for $to, this indicates that the scripts sending your emails contain errors.

  • Make sure that your outgoing messages do not use an SMTP server: Do not specify an SMTP server in your script parameters when using the PHP "mail()" function. If you have an interface for managing emails from your website, change this setting in your website’s configuration.

  • Check the total size of your email: The email sent must not exceed the total size of 10 MB (encapsulation and header included). The content of your email must not exceed 7/8 MB.

Managing "Disabled", "Bounce" and "SPAM" states

The "Disabled" status

This state occurs when:

  • Too many emails were sent in quick succession.
  • Too many emails are returned in error.
  • You have disabled the feature in your OVHcloud Control Panel.

To resolve this, go to the Web Cloud section, click on Hosting plans, then select the relevant hosting plan from the list. Click on the More tab, then select Email scripts.

Click on Emails in error, and wait a few minutes for the sending service to become active again.

The "Bounce" status

This state occurs when a certain percentage of your emails are automatically returned with an error state.

To resolve this, go to the Web Cloud section, click on Hosting plans, then select the relevant hosting plan from the list. Click on the More tab, then select Email scripts.

There are two options:

  • If you click on Emails in error, the service status will change to "Force". The ratio of returned emails to the total number of sent emails authorised before a block will be doubled. The sending will be operational again a few minutes after the unblocking.
  • If you click on Purge emails, this will erase all emails from the queue and the service status will change back to "Enabled" without doubling the ratio.

The "SPAM" status

This state occurs when spam emails are sent from your hosting.

Generally, this block is accompanied by the sending of an email titled “Abuse with your domain.tld hosting”, generated automatically by our security robots.

hosting

There are three possible scenarios for this situation:

  • Case 1: Robot operation on a contact form

To resolve this issue, you will need to secure all scripts that can send emails from your hosting plan, using a "Captcha" type system.

Open the Web Cloud section, click on Hosting plans, then select the relevant hosting plan from the list. Click on the More tab, then select Email scripts.

Click on Purge emails to erase all emails from the queue and the service status will change back to "Enabled".

In this case, a purge is required to delete the SPAM that is waiting to be sent.

  • Case 2: Malicious file injected into your hosting system

To correct this, you must do at least the following:

  • Analyse your hosting logs to identify security vulnerabilities and infected files.
  • Delete or correct the malicious file(s)/module(s).
  • For CMSs (WordPress, Joomla!, PrestaShop, Drupal, etc.), update the CMS, plugin(s) and associated theme.
  • Secure your contact forms with a Captcha.

If you are using a CMS, install only “official” plugins and themes. Update the CMS, plugins and associated theme as regularly as possible to avoid this happening again.

Once you have secured your hosting plan, go to the Web Cloud section, click on Hosting plans, then select the relevant hosting plan from the list. Click on the More tab, then select Email scripts.

Then click Purge emails, this will erase all emails from the queue and the service status will change back to "Enabled".

In this case, a purge is required to delete the SPAM that is waiting to be sent.

  • Case 3: Sending of legitimate emails considered as SPAM:

If you are the originator of the emails that caused the block, below are some examples of practices to avoid when sending an email (so that it is not immediately considered SPAM):

  • 3 or more words in upper case in the subject of the email.
  • Email with empty subject/body.
  • The email only contains an image larger than 1 MB and very little text.
  • The subject of the email starts with: Hi, FREE, BUY, BUYING, or similar phrasing.
  • The email contains more than 70% "white space" (abuse of the "SPACE" or "ENTER" key on the keyboard).
  • The font size used to write the email is extremely large.
  • The text colour and the background colour are the same.
  • The sender IP address (IP of your internet access point for example) has a negative reputation with spam protection services.
  • The header of the sent email does not respect the RFC email standards.
  • Links in the email are incorrect.
  • A URL in the email is not secure (example: a URL written as https://, while the actual URL only exists as http://).
  • The email contains terms of a pornographic nature or similar.
  • The email contains an executable (EXE, BAT, PIF, XML, XLSX or documents with macros); this applies even if the file is inside a compressed archive (.zip, .rar etc.).

If your service is still in a “SPAM” state, reply to the automatic email you received, specifying that you have taken the necessary measures.

Our antispam service will analyse the situation, and our support team will get back to you to explain the unblock procedure.

Sending emails using an "SMTP" script

OVHcloud provides services that you are responsible for with regard to their configuration and management. It is therefore your responsibility to ensure that they function properly.

This guide is designed to help you with common tasks. Nevertheless, we recommend contacting a specialist provider if you encounter any difficulties. We will not be able to assist you. You can find more information in the "Go further" section of this guide.

Although we strongly recommend using PHP’s "mail()" function, shared hosting allows you to send emails via a script that uses Simple Mail Transfer Protocol (SMTP). The total size of your email can not exceed 10 MB (i.e. 7/8 MB excluding encapsulation).

Emails sent with a script that uses an SMTP configuration cannot be managed and tracked from your OVHcloud Control Panel.

To do this, you can use the following script by replacing only the Host, Username and Password values with your own SMTP settings:

$mail->Host = "your.smtp.server";
$mail->SMTPAuth = true; 
$mail->SMTPSecure = "ssl";
$mail->Port = 465; 
$mail->Username = "e-mail@adress.tld"; 
$mail->Password = "YourEmailPassword"; 

Only if you use an OVHcloud email address, you can also use the SMTPSecure "startls" or "tls" with the Port 587. However, the SMTPSecure "ssl" with the Port 465 should be preferred.

Go further

View your hosting logs

Fix the 403 Forbidden page on your website

Restore your web hosting plan’s FTP storage space

For specialised services (SEO, development, etc.), contact OVHcloud partners.

If you would like assistance using and configuring your OVHcloud solutions, please refer to our support offers.

Join our community of users on https://community.ovh.com/en/.


Did you find this guide useful?

Please feel free to give any suggestions in order to improve this documentation.

Whether your feedback is about images, content, or structure, please share it, so that we can improve it together.

Your support requests will not be processed via this form. To do this, please use the "Create a ticket" form.

Thank you. Your feedback has been received.


These guides might also interest you...

OVHcloud Community

Access your community space. Ask questions, search for information, post content, and interact with other OVHcloud Community members.

Discuss with the OVHcloud community

In accordance with the 2006/112/CE Directive, modified on 01/01/2015, prices exclude VAT. VAT may vary according to the customer's country of residence.