SMTP Error: The following recipients failed u

2011-08-12
2012-09-18
  • mittul chauhan
    mittul chauhan
    2011-08-12

    hello .. i have a website in which i want to send emails using php version 5.x
    ..

    so i have downloaded PHPMAILER VERSION 5.X and uploaded the whole folder using
    FTP to my website ...

    now to my WWW folder i have made one php webpage called as testmail.php ..
    here is my code ..

    --------------------------------------…
    testmail.php


    <?php

    ini_set("include_path", ".:/orange/phpmailer/");

    require_once("class.phpmailer.php");

    $mailer = new PHPMailer();

    $mailer->IsSMTP();

    $mailer->Host = 'myhost address.com';

    $mailer->SMTPAuth = true;

    $mailer->Username = 'myusername.com';

    $mailer->Password = 'my password';

    $mailer->FromName = 'name';

    $mailer->From = 'from@address.com';

    $mailer->AddAddress('to@address.com');

    $mailer->Subject = 'Subject';

    $mailer->Body = 'body Text';

    if(!$mailer->Send())

    {

    echo "Message was not sent";

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

    exit;

    }

    ?>

    --------------------------------------…

    but as soon as i run this page, m keep getting this error saying . .

    --------------------------------------…
    SMTP Error: The following recipients failed: to@address.com Message was not
    sentMailer Error: SMTP Error: The following recipients failed: to@address.com

    SMTP server error: No such user here

    --------------------------------------…
    what ever email address i write here

    --------------------------------------…
    $mailer->AddAddress('to@address.com');

    --------------------------------------…
    m getting that email as an error above

    can you tell why m getting this error ..i have tried so many email id and
    valid email ids there which are currently enable and running .. still getting
    the same error whichever email i use ...

    whats wrong in my code ..

    please help me ..