Note that there are some explanatory texts on larger screens.

plurals
  1. POunable to send mail in php using mailer class
    primarykey
    data
    text
    <p>Today i was doing some mailing stuff in the php, I found that there are two methods for that one is the simple mail function provided by the Php and the second i found on the internet it was about using the PHP mailer class from the site <a href="https://github.com/PHPMailer/PHPMailer" rel="nofollow">https://github.com/PHPMailer/PHPMailer</a>. the problem is that which i run my program than the mail is not being sent. Let's have a look at the code</p> <pre><code>&lt;?php include 'PHPMailer-master/class.phpmailer.php'; $mail = new PHPMailer(); // create a new object $mail-&gt;IsSMTP(); // enable SMTP $mail-&gt;SMTPDebug = 1; // debugging: 1 = errors and messages, // 2 = messages only $mail-&gt;SMTPAuth = true; // authentication enabled $mail-&gt;SMTPSecure = 'tls'; // secure transfer enabled REQUIRED for GMail $mail-&gt;Host = "smtp.gmail.com"; $mail-&gt;Port = 465; # or 587 $mail-&gt;IsHTML(true); $mail-&gt;Username = "singh6@gmail.com"; $mail-&gt;Password = "88888*******"; $mail-&gt;SetFrom('singh@gmail.com'); $mail-&gt;AddAddress('sanu@gmail.com'); $mail-&gt;Subject = "Test"; $mail-&gt;Body = "hello"; $sendResult = $mail-&gt;Send(); if ($sendResult) { echo "Message has been sent"; } else { echo "Mailer Error: " . $mail-&gt;ErrorInfo; } </code></pre> <p>Now when I run this script I get the following error:</p> <pre><code>CLIENT -&gt; SMTP: EHLO localhost SMTP -&gt; ERROR: EHLO not accepted from server: CLIENT -&gt; SMTP: HELO localhost </code></pre> <blockquote> <p>Notice: fwrite(): send of 16 bytes failed with errno=10054 An existing connection was forcibly closed by the remote host. in C:\xampp\htdocs\program\mailsending1\mailsending_v1\PHPMailer-master\class.smtp.php on line 1023</p> </blockquote> <pre><code>SMTP -&gt; ERROR: HELO not accepted from server: SMTP -&gt; NOTICE: EOF caught while checking if connected SMTP Connect() failed. Mailer Error: SMTP Connect() failed. </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload