Rate this article :
3.8/5 | 4 opinion
This article was useful to you ?
Yes
No
Vous avez noté 0 étoile(s)
Sommaire
Procédure
1. log in to your web hosting management interface and click on the "PHP configuration" button
2. Check that the PHPMail() function is set to"ON".
You can test the PHPMail() function using a small script to be set up on a PHP page.
The script will give you confirmation that the email has been sent on the PHP page and will allow you to check that the email has been received at the destination inbox.
<?php //Testing the mail() function; // *** To be configured by you $to = "monemail@gmail.com"; // Put in the receiving email $from = "monemail@domaine.ext"; // Email address of the recipient of the email, the one attached to your LWS domain. // Do not modify the lines below $JOUR = date("Y-m-d"); // Day the email was sent $HEURE = date("H:i"); // Time the email was sent $Subject = "Test Mail - $JOUR $HEURE"; $mail_Data = ""; $mail_Data .= " \n"; $mail_Data .= " \n"; $mail_Data .= " \n"; $mail_Data .= " \n"; $mail_Data .= " \n"; $mail_data .= "Simple HTML Mail : $Subject \n"; $mail_Data .= " \n"; $mail_Data .= "This is a test email from PHP's mail function \n"; $mail_Data .= "Etc. \n"; $mail_Data .= " \n"; $mail_Data .= " \n"; $headers = "MIME-Version: 1.0 \n"; $headers .= "Content-type: text/html; charset=utf-8 \n"; $headers .= "From: $from \n"; $headers .= "Disposition-Notification-To: $from \n"; // High Priority Message // ------------------------- $headers .= "X-Priority: 1"; $headers .= "X-MSMail-Priority: High"; $CR_Mail = TRUE; $CR_Mail = @mail ($to, $Subject, $mail_Data, $headers); if ($CR_Mail === FALSE) echo " ### CR_Mail=$CR_Mail - Error sending mail"; else echo " *** CR_Mail=$CR_Mail - Mail sent"; ?>
To test that the email has been sent and received, simply open the URL of the page containing your script. If it worked, you should see this:
*** CR_Mail=1 - Mail sent
If not, you will get the following return, which indicates that the PHPMail() function is deactivated on your shared hosting:
### CR_Mail=0 - Error sending mail
If the PHPMail() function is active on your client interface and the PHP script sends you "CR_Mail=0 - Error sending mail", there is a good chance that the PHPMail() function has been deactivated as a result of numerous SPAMS. If this is the case, you will need to contact Technical Support who will tell you what to do.
There may be an error in the recipient's email address. To be sure, you need to check the Apache/Php logs.
1. connect to the administration of your web hosting and click on"Notfication disponibles: Cliquez ici pour les voir"".
2. You will be able to see what the problem is. You will be able to see whether the problem is related to an email address and/or whether it is a script or contact form on a web page. In the case of a script, most of the time the problem is due to the absence of the Captcha field on the contact form.
By clicking on the"Click here" tab on the"See the source of the email causing the problem" line, you will be able to find out more about the email in question.
Rate this article :
3.8/5 | 4 opinion
This article was useful to you ?
Yes
No
5mn reading
How do I create and use an .htaccess file with the LWS Panel?
0mn reading
How to configure SMTP on a CMS
1mn reading
How do I create an htaccess file to rewrite a URL?
0mn reading
How do I update Wordpress to the latest version?