Click here to Skip to main content
15,887,410 members
Home / Discussions / Web Development
   

Web Development

 
QuestionBest HTML editor? Pin
Chris Maunder18-Oct-15 16:49
cofounderChris Maunder18-Oct-15 16:49 
AnswerRe: Best HTML editor? Pin
Richard Deeming19-Oct-15 3:00
mveRichard Deeming19-Oct-15 3:00 
AnswerRe: Best HTML editor? Pin
W Balboos, GHB19-Oct-15 7:26
W Balboos, GHB19-Oct-15 7:26 
GeneralRe: Best HTML editor? Pin
Chris Maunder19-Oct-15 8:50
cofounderChris Maunder19-Oct-15 8:50 
GeneralRe: Best HTML editor? Pin
hightower1220-Oct-15 12:01
professionalhightower1220-Oct-15 12:01 
GeneralRe: Best HTML editor? Pin
mangu Santosh kumar23-Oct-15 17:50
mangu Santosh kumar23-Oct-15 17:50 
GeneralRe: Best HTML editor? Pin
DrewHolloway30-Oct-15 5:28
DrewHolloway30-Oct-15 5:28 
QuestionUnable to send using PHPMailer and Gmail Pin
Jassim Rahma15-Oct-15 5:34
Jassim Rahma15-Oct-15 5:34 
Hi,

I am trying to send email from my gmail business and PHPMailer but getting below error. I am 100000% sure about the password because I am able to login using the same passoword.

Here is my code:
PHP
//Create a new PHPMailer instance
$mail = new PHPMailer();
//Tell PHPMailer to use SMTP
$mail->IsSMTP();
//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
$mail->SMTPDebug  = 2;
//Ask for HTML-friendly debug output
$mail->Debugoutput = 'html';
//Set the hostname of the mail server
$mail->Host       = "smtp.gmail.com";
$mail->SMTPSecure = 'tls';
//Set the SMTP port number - likely to be 25, 465 or 587
$mail->Port       = 587;
//Whether to use SMTP authentication
$mail->SMTPAuth   = true;
//Username to use for SMTP authentication
$mail->Username   = "noreply@smashburgerbahrain.com";
//Password to use for SMTP authentication
$mail->Password   = "xxxxxxxxxxxxxxxxx";
//Set who the message is to be sent from
$mail->SetFrom("noreply@smashburgerbahrain.com", "Smashurger");
// display the from name and email;
// $mail->FromName = $_POST['txtName'] ." <" . $_POST['txtEmail'] . ">";
//Set an alternative reply-to address
// $mail->AddReplyTo($_POST['txtEmail'], $_POST['txtName']);
//Set who the message is to be sent to
$mail->AddAddress($email_address, $email_address);

//Replace the plain text body with one created manually
$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
//Attach an image file
// $mail->AddAttachment('images/phpmailer_mini.gif');
// $mail->AddCustomHeader($mail_header); 

//Set the subject line
$mail->Subject = "Welcome to Smashburger";

//Read an HTML message body from an external file, convert referenced images to embedded, convert HTML into a basic plain-text alternative body
// $mail->MsgHTML($body);
$mail->Body = $body;
$mail->CharSet = 'UTF-8';
$mail->IsHTML(true);

//Send the message, check for errors
if(!$mail->Send()) {
  echo "Mailer Error: " . $mail->ErrorInfo;
} else {
  echo "Message sent!";
}

This is the ERROR:
SMTP -> FROM SERVER:220 smtp.gmail.com ESMTP h108sm5648856qge.21 - gsmtp
CLIENT -> SMTP: EHLO smashburgerbahrain.com
SMTP -> FROM SERVER: 250-smtp.gmail.com at your service, [173.236.137.128]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8
CLIENT -> SMTP: STARTTLS
SMTP -> FROM SERVER:220 2.0.0 Ready to start TLS
CLIENT -> SMTP: EHLO smashburgerbahrain.com
SMTP -> FROM SERVER: 250-smtp.gmail.com at your service, [173.236.137.128]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8
CLIENT -> SMTP: AUTH LOGIN
CLIENT -> SMTP: bm9yZXBseUBzbWFzaGJ1cmdlcmJhaHJhaW4uY29t
CLIENT -> SMTP: TXVqdGFiYUAyMDE1
SMTP -> ERROR: Password not accepted from server: 534-5.7.14 <https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbvDK534-5.7.14 AwRHY7MTTkREbKmKJBCJQOfC2xDhFNsnIrFD1l6HD52B9G6PfrlkjRgKPthtSHjMP6SqBB534-5.7.14 --MIzJIGCQR3wBZDisXU6pGtZHEiFvF3q_bUU1S0LRahwyHTxeI1abwnNSlv58jcN63T6b534-5.7.14 KhHnCPneegmwsY-9YPTav-BsQXSc8H-7RqVvBYN25oFPhJk1MUGdYdUCHZcWozp8mP_L9_534-5.7.14 ETMlGC-uTXoAncJ9XLJZSyRZL3PE> Please log in via your web browser and534-5.7.14 then try again.534-5.7.14 Learn more at534 5.7.14 <a href="https://support.google.com/mail/answer/78754">https://support.google.com/mail/answer/78754</a> h108sm5648856qge.21 - gsmtp
CLIENT -> SMTP: quit
SMTP -> FROM SERVER:221 2.0.0 closing connection h108sm5648856qge.21 - gsmtp
SMTP Connect() failed.
Mailer Error: SMTP Connect() failed.

Thanks,
Jassim[^]

Technology News @ www.JassimRahma.com

AnswerRe: Unable to send using PHPMailer and Gmail Pin
F-ES Sitecore15-Oct-15 23:09
professionalF-ES Sitecore15-Oct-15 23:09 
Questioncustom Css not working on MAC operating system Pin
Gurjit Singh8-Oct-15 22:57
Gurjit Singh8-Oct-15 22:57 
AnswerRe: custom Css not working on MAC operating system Pin
Mona sinha11-Nov-15 18:45
professionalMona sinha11-Nov-15 18:45 
QuestionPost Asp.net form using jquery to a webservice and process return data in xml format RSS Pin
Deepak Arjun7-Oct-15 20:23
Deepak Arjun7-Oct-15 20:23 
AnswerRe: Post Asp.net form using jquery to a webservice and process return data in xml format RSS Pin
F-ES Sitecore15-Oct-15 23:12
professionalF-ES Sitecore15-Oct-15 23:12 
QuestionTechnical image resource sites Pin
Md. Marufuzzaman25-Sep-15 19:24
professionalMd. Marufuzzaman25-Sep-15 19:24 
AnswerRe: Technical image resource sites Pin
Richard MacCutchan25-Sep-15 22:14
mveRichard MacCutchan25-Sep-15 22:14 
AnswerRe: Technical image resource sites Pin
Afzaal Ahmad Zeeshan25-Sep-15 23:27
professionalAfzaal Ahmad Zeeshan25-Sep-15 23:27 
Questiondoubt Pin
gowtham muthu25-Sep-15 3:36
gowtham muthu25-Sep-15 3:36 
AnswerRe: doubt Pin
User 41802545-Oct-15 10:04
User 41802545-Oct-15 10:04 
QuestionMessage Closed Pin
23-Sep-15 13:20
Member 1200729323-Sep-15 13:20 
QuestionHow to create secure login using angular js Pin
Member 1199959720-Sep-15 23:23
Member 1199959720-Sep-15 23:23 
SuggestionRe: How to create secure login using angular js Pin
Kornfeld Eliyahu Peter20-Sep-15 23:50
professionalKornfeld Eliyahu Peter20-Sep-15 23:50 
AnswerRe: How to create secure login using angular js Pin
Richard MacCutchan21-Sep-15 0:28
mveRichard MacCutchan21-Sep-15 0:28 
SuggestionRe: How to create secure login using angular js Pin
Richard Deeming21-Sep-15 2:41
mveRichard Deeming21-Sep-15 2:41 
AnswerRe: How to create secure login using angular js Pin
Richard Deeming21-Sep-15 2:47
mveRichard Deeming21-Sep-15 2:47 
QuestionHow to create secure login procedure in angular js Pin
Member 1199959720-Sep-15 23:22
Member 1199959720-Sep-15 23:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.