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

Vous souhaitez nous laisser un commentaire concernant cet article ?

Si cela concerne une erreur dans la documentation ou un manque d'informations, n'hésitez pas à nous en faire part depuis le formulaire.

Pour toute question non liée à cette documentation ou problème technique sur l'un de vos services, contactez le support commercial ou le support technique

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 445 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 445 days

Bonjour,

Je vous remercie pour votre message.

Nous ne rencontrons pas de problèmes particuliers avec le fonctionnement de nos services actuellement ou depuis vendredi dernier.

Ce problème peut venir de votre connexion internet, d'un blocage IP ou du logiciel de transfert FTP utilisé.

Afin qu'un agent puisse analyser en détail votre problème et vous trouver une solution, je vous invite à contacter notre support technique depuis la rubrique "assistance" de votre espace client.

Cordialement, L'équipe LWS

Utile ?

Ask the LWS team and its community a question