php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46314 sending e-mail through SMTP fail
Submitted: 2008-10-16 12:51 UTC Modified: 2008-10-16 19:03 UTC
From: s_khreiss at hotmail dot com Assigned:
Status: Not a bug Package: Mail related
PHP Version: 5.2.6 OS: Windows XP
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: s_khreiss at hotmail dot com
New email:
PHP Version: OS:

 

 [2008-10-16 12:51 UTC] s_khreiss at hotmail dot com
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>";
        }
    }



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-10-16 19:03 UTC] tularis@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC