Problem with using PHPMailer for SMTP

Posted by Frozenfire on Stack Overflow See other posts from Stack Overflow or by Frozenfire
Published on 2011-09-23T07:51:22Z Indexed on 2012/09/17 3:38 UTC
Read the original article Hit count: 183

Filed under:
|
|

I have used PHPMailer for SMTP and there is problem in sending mail with error "Mailer Error: The following From address failed: [email protected]"

My code is as follows:

        $mail = new PHPMailer();

        $mail->IsSMTP();                                   // send via SMTP

        $mail->Host = "localhost;"; // SMTP servers

        $mail->SMTPAuth = true;     // turn on SMTP authentication

        $mail->Username = "";  // SMTP username

        $mail->Password = ""; // SMTP password



        $mail->From = $email_address;

        $mail->FromName = $email_address;

        $mail->AddAddress($arrStudent[0]["email"]);

        $mail->WordWrap = 50;                              // set word wrap

        $mail->IsHTML(true);                               // send as HTML



        $mail->Subject = "Subject";

        $theData = str_replace("\n", "<BR>", $stuff);

        $mail->Body = $theData; // "This is the <b>HTML body</b>";

        $mail->AltBody = $stuff;




        if (!$mail->Send()) {

            $sent = 0;

            echo "Mailer Error: " . $mail->ErrorInfo;

            exit;

        }

i researched everything and when i debug inside class.smtp.php i found error the function "get_lines()" is returning error value "550 Authentication failed"

The code was working fine previously, i am wondering how this problem came suddenly. Desperate for some help.

Thanks, Biplab

© Stack Overflow or respective owner

Related posts about php

Related posts about smtp