PHP Classes

Gmail Use Authentication

Recommend this page to a friend!

      SMTP E-mail sending class  >  All threads  >  Gmail Use Authentication  >  (Un) Subscribe thread alerts  
Subject:Gmail Use Authentication
Summary:How to implement Use Authentication: Yes to send with Gmail
Messages:17
Author:Said Bakr
Date:2008-03-09 20:38:20
Update:2009-05-01 08:55:28
 
  1 - 10   11 - 17  

  1. Gmail Use Authentication   Reply   Report abuse  
Picture of Said Bakr Said Bakr - 2008-03-09 20:38:20
Hello,

I'm using the test_smtp.php example attached with the package. From gmail configuration found at http://mail.google.com/support/bin/answer.py?hl=en&answer=13287 I can assign all required properties values to the smtp object except Authentication: Yes . i.e ssl = 1 and others,

How can I set this property of the object Authentication: Yes

Best Regards,
Said Bakr

  2. Re: Gmail Use Authentication   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2008-03-09 22:40:33 - In reply to message 1 from Said Bakr
You need to set the port variable 465, set the ssl variable to 1 and include the sasl.php class file so it knows how to authenticate via LOGIN method.

  3. Re: Gmail Use Authentication   Reply   Report abuse  
Picture of Paul roberts Paul roberts - 2008-05-07 18:40:11 - In reply to message 2 from Manuel Lemos

i have

require("smtp_mail/smtp_mail.php");
require("smtp_mail/sasl.php");

$message_object->smtp_host="smtp.gmail.com";
$message_object->smtp_port='465';
$message_object->smtp_user='[email protected]';
$message_object->smtp_password='********';
$message_object->smtp_ssl=1;
$message_object->smtp_debug=1;

imap/pop is set up and the account is Google apps for domains but nothing happens

any ideas.

  4. Re: Gmail Use Authentication   Reply   Report abuse  
Picture of Paul roberts Paul roberts - 2008-05-07 20:43:59 - In reply to message 3 from Paul roberts
I sorted this, it was the open ssl extension not being enabled on my local server.

  5. Re: Gmail Use Authentication   Reply   Report abuse  
Picture of neeraj kumar neeraj kumar - 2008-05-08 05:42:18 - In reply to message 4 from Paul roberts
I am getting this error, can any body help me

Resolving SMTP server domain "smtp.gmail.com"...
Connecting to host address "209.85.199.111" port 465...
Connected to SMTP server "smtp.gmail.com".
S 220 mx.google.com ESMTP f42sm3868611rvb.5
C EHLO 192.168.2.80
S 250-mx.google.com at your service, [202.68.142.130]
S 250-SIZE 28311552
S 250-8BITMIME
S 250-AUTH LOGIN PLAIN
S 250 ENHANCEDSTATUSCODES
C AUTH LOGIN
S 334 VXNlcm5hbWU6
C bmVlcmFqaw==
S 334 UGFzc3dvcmQ6
C dGVzdDEyMzQ=
S 535-5.7.1 Username and Password not accepted. Learn more at
Cound not send the message to [email protected]. Error: 535-5.7.1 Username and Password not accepted. Learn more at
thanks

  6. Re: Gmail Use Authentication   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2008-05-08 06:05:39 - In reply to message 5 from neeraj kumar
That means what the error message says: that either the user or password are incorrect.

  7. Re: Gmail Use Authentication   Reply   Report abuse  
Picture of neeraj kumar neeraj kumar - 2008-05-08 06:52:00 - In reply to message 6 from Manuel Lemos
hi,
i have checked but it is giving same errors.

  8. Re: Gmail Use Authentication   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2008-05-08 07:18:46 - In reply to message 7 from neeraj kumar
A couple of notes:

1. I tried my Gmail account with the example script and it works. So, I am sure that your password or account are wrong as the message says.

2. Please do not post the debug script like that without obfuscating the sensitive information because it is easy to decode your user name and password.

  9. Re: Gmail Use Authentication   Reply   Report abuse  
Picture of neeraj kumar neeraj kumar - 2008-05-08 08:00:07 - In reply to message 8 from Manuel Lemos
Thanks a lot it is working.

  10. Re: Gmail Use Authentication   Reply   Report abuse  
Picture of nettcom nettcom - 2008-08-03 15:44:21 - In reply to message 9 from neeraj kumar
I am with same error, can you post your solution for fix?

regaarrds

 
  1 - 10   11 - 17