Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Mail

smtp error : could not authenticate

the mail() function

Moderators: macek, egami, gesf

smtp error : could not authenticate

Postby nadi » Sun Nov 04, 2012 5:59 pm

hai there..

I got this error using PHPMailer.

currently if i put under my localhost it go smoothly never came out any error, but once i put under my hosting it show an error smtp error: could not authenticate, please advise me what should i do.. :( :( :( :(

and Here is the code.

$mail = new PHPMailer();

if(!empty($data->MEM_EMAIL)){
$header = "<font class='type3'>Dear ".$data->MEM_NAME.",\n<br><p>
<font class='type3'>Below is your password. Please login using :-<br><br>\n\n
</font>
<font class='type3'>Username : <b>".$data->MEM_UN."</b>\n<br>
<font class='type3'>Password : <b>".$newpwd."</b>\n<br><p>";
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
$mail->Host = "smtp.gmail.com";
$mail->Port = 465;
$mail->Username = "xxxxxxxxx@gmail.com";
$mail->Password = "xxxxxxx";

$mail->SetFrom('xxxxxx@gmail.com', 'Team');
$mail->Subject = "Username & Password Request";
$mail->AltBody = "<br>This email has been automatically generated from an
unmonitored mailbox. Please do not use the reply function.";

$mail->MsgHTML($header);
$address = $data->MEM_EMAIL; // address send to :
$mail->AddAddress($address,"");
$mail->Send();
}else{
echo "<script>alert('Email not exist for this ID : ".$mem_id."');</script>";
}
}


:help: :help: :help: :help: :help:
User avatar
nadi
New php-forum User
New php-forum User
 
Posts: 9
Joined: Sun Mar 04, 2012 11:19 pm

Return to PHP coding => Mail

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron