Click here to Skip to main content
15,393,377 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

I am using php mailer to send mail from localhost but it is not working and showing the below given error:

Invalid address: SMTP -> ERROR: Password not accepted from server: 534-5.7.14 Please log in via your web browser and then try again. 534-5.7.14 Learn more at 534 5.7.14 4sm6769939pdo.19 - gsmtp
SMTP Error: Could not authenticate.

The code i am using to send mail is-


$mail             = new PHPMailer();

$mail->SMTPAuth   = true;
$mail->SMTPDebug  = 1;
$mail->SMTPSecure = "ssl";
$mail->Username   = "";
$mail->Password   = ";
$mail->Host       = "";
$mail->Mailer = 'smtp';
$mail->Port       = 465;

$mail->SetFrom('', 'asd');
$mail->Subject    = $s;
$mail->Body    = "helo testing mail";


<html><h1>Sending mail</h1>
<table align="center" border="1">
<tr><td>to</td><td><input type="text" name="to" /></td></tr>
<tr><td>subject</td><td><input type="text" name="subject" /></td></tr>
<tr><td>body</td><td><input type="text" name="body" /></td></tr>
<tr><td><input type="submit" name="send" value="send" /></td></tr>

I have uncomment openssl.dll in php.ini file.

But still my code is not working.

vbmike 13-Apr-15 8:15am, site has numerous suggestions.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900