I have a problem, I get this error message under my code: The message could not be sent. Mailer error: SMTP error: The following recipients failed !! Sensor!
I have seen hosts, ports, usernames, passwords, recipients and everyone, what's the problem? Thanks!
Can you kindly explain cuz I is new to PHP coding
Host = 'sensor!'; // Specify main and backup SMTP servers $ Mail- & gt; SMTPAuth = true; // Enable SMTP authentication $ Mail- & gt; Username = '! Sensor! '; // SMTP username $ mail- & gt; Password = '! Sensor! '; // SMTP Password $ Mail- & gt; SMTPSecure = 'TLS'; // Enable TLS encryption, `SSL 'has $ Mail-> Port = 587; // TCP to connect to mail port-mail-> From = $ email; $ Mail- & gt; Sainam = $ name; $ Mail & gt; AddAddress ('! Sensor!'); // A recipient $ Mail-> Add Ad Attachment ('/ var / tmp / file.tar.gz'); // Add attachment $ Mail-> Ad Attachment ('/ tmp / image.jpg', 'new.jpg'); // Alternative Name $ Mail- & gt; Is HTML (true); // Email Formatting HTML $ mail- & gt; Subject = $ theme; $ Mail- & gt; Body = $ message; $ Mail- & gt; AltBody = $ message; If (! $ Mail- & gt; send ()) {echo 'message could not be sent'. '; Echo 'mailer error:' $ Mail & gt; ErrorInfo; } And {echo 'message has been sent'; }
Edit: I got the problem, the problem was not in the PHP code. It was in the contact form. The problem started when I kept the variable as the name and email. If email is not verified, then it does not work
This error may be due to some different things is. You can get a better view of the reason by adding the following line to your PHPMailer script:
$ mail-> SMTPDebug = 2; // & lt; - To debug
Once you do this, you can check the following things that can cause an error:
1.) File a corrupted .phpmailer.php file.
2.) The error may be due to security by your ISP.
4.) Set the SMTPP to the right for the PHPMailer class.
3.
3. P> 5.) Exclude the following line in your PHPMailer script: $ mail-> isSMTP ();
Most likely, your phpmailer
class file has been corrupted.
Download the latest version:
No comments:
Post a Comment