Error 542, You are not allowed to send your message when sending mail

Procédure

Why does this error occur?

This error occurs when the e-mail address entered in your code is not authorised to send e-mails from the SMTP server.

How can I fix this problem?

To send an email in PHP, via a form, you need to use the following code:

$to = "test@test.com"; $from = "test@votredomaine.com"; $entete = "MIME-Version: 1.0"; $entete .= "Content-type: text/html; charset=iso-8859-1\r\n"; $entete .= "From: $from <  $from  >\r\n"; $entete .= "Reply-to: $from\r\n"; $entete .= "X-Mailer: PHP\r\n"; $entete .= "X-Priority: 1\r\n"; $entete .= "Return-Path: <  $from  > \r\n"; $msg = "test\r\n"; $sujet = "*** Test Mail ***\r\n"; $res = (mail($to,$sujet,$msg,$entete)); if (true === $res) { $texte = "Mail sent to"".$to."\"\n"; printf (nl2br("$texte")); } else { $texte = "**** ERROR : PROBLEM SENDING MAIL ! ****"; printf (nl2br("$text")); } 

1. On shared hosting, the sender address ($from in the code) must be the one attached to your domain. The address must also be different from that of the recipient, otherwise you will see the error message 542( You are not allowed) appear and your email will not be sent.

2. If you wish to use a sender address other than the one attached to your domain, you will need to subscribe to a virtual server. We invite you to discover our offers from this link: VPS server (from €9.99/month excluding VAT) .

Rate this article :

This article was useful to you ?

Article utileYes

Article non utileNo

MerciMerci ! N'hésitez pas à poser des questions sur nos documentations si vous souhaitez plus d'informations et nous aider à les améliorer.


Vous avez noté 0 étoile(s)

Similar articles

0mn reading

Cloudflare Error 524 : A timeout occured

3mn reading

How to correct a 500 error on your site with LWS Panel

10mn reading

How do I correct HTTP error codes?

0mn reading

404 error, what it is and how to correct it


Questions sur l'article
JFB Il y a 969 days
Nous sommes lundi 31 juillet, il est 15 heures. Depuis vendredi vers environ 14 heures, sur plusieurs sites chez LWS, la connexion FTP est très lente voire impossible et quand toutefois elle aboutit, aucune modification n'est effectuée.
See the
1 answers
Aurelien-LWS - Il y a 969 days

Hello,

Thank you for your message.

We are not experiencing any particular problems with the operation of our services at present or since last Friday.

The problem may be due to your Internet connection, an IP block or the FTP transfer software you are using.

So that an agent can analyze your problem in detail and find a solution for you, I invite you to contact our technical support from the "support" section of your customer area.

Sincerely, The LWS team

Utile ?

Ask the LWS team and its community a question