|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-10-16 19:03 UTC] tularis@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 19:00:01 2025 UTC |
Description: ------------ Dear, In our Website we have an option to send an e-mail..where I'am using the send_email function to send via SMTP. the function was working correctly and e-mails were sent, but today when trying to send an e-mail, it gives me: 'error: send e-mail failed. SMTP is up and running. (we re-start it and we re-start the IIS server but nothing change) please I need help to know why mail are not sent. (here is the function) thank you, Sincerely, Reproduce code: --------------- function send_email($to, $subject, $message, $from, $name) { require("includes/class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsSMTP(); // send via SMTP $mail->Host = "localhost"; // SMTP servers $mail->SMTPAuth = false; // turn on SMTP authentication $mail->From = $from; $mail->FromName = $name; $mail->AddAddress($to);// optional name $mail->AddReplyTo($to,""); $mail->WordWrap = 50; // set word wrap $mail->IsHTML(true); // send as HTML $mail->Subject = $subject; $mail->Body = $message; $mail->AltBody = $message; if(!$mail->Send()) { print"<script> alert('error: send e-mail failed'); window.close() </script>"; echo "Mailer Error: " . $mail->ErrorInfo; } else { print"<script> alert('e-mail sent successfully'); window.close() </script>"; } }