SMTP Error: Could not authenticate.
SMTP server error: 5.7.14 Please log in via your web browser and then try again. 534-5.7.14 Learn more at https://support.google.com/mail/bin/answer.py?answer=787 534 5.7.14 54 e67sm2084558qge.13 - gsmtp

Recommended Answers

All 6 Replies

Show your code.

Your SMTP login information is incorrect judging by the error alone.
Check your username and password is right.

Did you turn on Forwarding POP/IMAP function in your gmail account ?

yes everything is enable pop/imap funcation enabled

<?php
//I am using it on gmail with mail.smtp.com
//session_start();
require("PHPMailer_5.2.4/class.phpmailer.php");

$fn = $_POST['name1'];
$ln = $_POST['address'];
$company = $_POST['email'];
$em = $_POST['comments'];
/*$mob = $_POST['mobile_no'];
$ca = $_POST['challenge_area'];
$ar = $_POST['area'];
$ct= $_POST['city'];*/

// $email and $message are the data that is being
// posted to this page from our html contact form
//$email = $_REQUEST['email'] ;


// When we unzipped PHPMailer, it unzipped to
// public_html/PHPMailer_5.2.0


$mail = new PHPMailer();

$mail->IsSMTP();  // telling the class to use SMTP
$mail->SMTPAuth   = true; // SMTP authentication
$mail->Host       = "mail.urwebsite.com"; // SMTP server
$mail->Port       = 587; // SMTP Port
$mail->Username   = "query@urwebsite.com"; // SMTP account username
$mail->Password   = "query123";        // SMTP account password

$mail->SetFrom('query@urwebsite.com','website'); // FROM
$mail->AddReplyTo('query@urwebsite.com', 'website'); // Reply TO

$mail->AddAddress('query@urwebsite.com', 'website'); // recipient email

$mail->Subject    = "You have received feedback from your website!"; // email subject
$mail->Body    = $fn . " has contacted query@squirrels.co.in at Squirrels.\nFirst Name : " .$fn . "\nLast name: " .$ln . "\nCompany: " .$company . "\nEmail: " .$em; //. "\nMobile: " .$mob . "\nCity: " .$ct . "\nChallenge Area: " .$ca . "\nArea: " .$ar;

if(!$mail->Send()) 
    {
             echo 'Message was not sent.';
         echo 'Mailer error: ' . $mail->ErrorInfo;
    } 
    else {
            echo"<script>alert('Thanks For Your Interest')</script>";
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.