sarithak 0 Junior Poster

Hi frnds....

In my hosting server they didnt set the SMTP properties perfectly....So, i used the below code...but, this working from last 1 month.but,unfortunatley this code not working from last couple of days..I am getting error...plz check the below code & error message....

$to = "TargetName <abv@xxxx.com>";

$host = "mail.xxxxx.com";
$username = "info@xxxxxx.com";
$password = "info";
//$messg= 'Subject :'.$subject.'---'.'Name :'.$Name.'Phone :'.$Phone.'---'.'From :'.$from.'---'.'Family :'.$Family.'---'.'Message :'.$message;
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject, 'Phone No'=>$phone, 'Message'=>$Family);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => true,
'username' => $username,
'password' => $password));
$mail = $smtp->send($to, $headers, $message);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {

header("location:contactus.html?msg=Message Successfully sent"); 
}

Error:

Failed to add recipient: xxx@xxxxxx.com [SMTP: Invalid response code received from server (code: 550, response:  No such user here)]

Please check the above code...i am struggling from last couple of days...

Thank U...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.