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

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 https://support.google.com/mail/bin/answer.py?answer=78754 4sm6769939pdo.19 - gsmtp
SMTP Error: Could not authenticate.

The code i am using to send mail is-
XML
<?php
    if(isset($_REQUEST['send']))
{
$t=$_POST['to'];
$s=$_POST['subject'];
$b=$_POST['body'];

require_once('phpmailer/class.phpmailer.php');

$mail             = new PHPMailer();

$mail->IsSMTP();
$mail->SMTPAuth   = true;
$mail->SMTPDebug  = 1;
$mail->SMTPSecure = "ssl";
$mail->Username   = "kakminder@gmail.com";
$mail->Password   = ";
$mail->Host       = "smtp.gmail.com";
$mail->Mailer = 'smtp';
$mail->Port       = 465;

$mail->SetFrom('asd@gmail.com', 'asd');
$mail->Subject    = $s;
$mail->Body    = "helo testing mail";
$mail->AddAddress($t);
$mail->AddAddress('saini.1985@gmail.com','deepak');
$mail->AddAddress('akm@rediffmail.com','akm');

$mail->Send();
   }
    ?>

<html><h1>Sending mail</h1>
<body>
<form>
<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>
</table></form></body></html>




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

But still my code is not working.


Thanks
Posted
Comments
vbmike 13-Apr-15 8:15am    
http://serverfault.com/questions/635139/how-to-fix-send-mail-authorization-failed-534-5-7-14, 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