|
|
 ahmet guven | 2007-03-07 02:36:28 |
Hello , I have tried many methods for gmail , But it is not works.
Could you help me to understand what's wrong ?
There is the debug :
Resolving SMTP server domain "smtp.gmail.com"...
Connecting to host address "209.85.135.109" port 465...
Connected to SMTP server "smtp.gmail.com".
S 220 mx.google.com ESMTP u9sm166842muf
C EHLO 69.59.x.x
S 250-mx.google.com at your service, [69.59.x.x]
S 250-SIZE 20971520
S 250-8BITMIME
S 250-AUTH LOGIN PLAIN
S 250 ENHANCEDSTATUSCODES
C MAIL FROM:<xxxxx@gmail.com>
S 530 5.5.1 Authentication Required u9sm166842muf
Disconnected.
Cound not send the message to yyyyy@hotmail.com. Error: 530 5.5.1 Authentication Required u9sm166842muf
|
 Manuel Lemos | 2007-03-07 03:32:33 - In reply to message 1 from ahmet guven |
To send messages via Gmail SMTP server, you need to specify the Gmail user name and password and also include the SASL class:
http://www.phpclasses.org/sasl
require("sasl.php");
$from="gmailuser@gmail.com";
$to="recipient@domain.com";
$smtp=new smtp_class;
$smtp->host_name="smtp.gmail.com";
$smtp->host_port=465;
$smtp->ssl=1;
$smtp->localhost="localhost";
$smtp->direct_delivery=0;
$smtp->timeout=10;
$smtp->data_timeout=0;
$smtp->debug=1;
$smtp->html_debug=1;
$smtp->pop3_auth_host="";
$smtp->user="gmailuser";
$smtp->realm="";
$smtp->password="gmailpassword";
$smtp->workstation="";
$smtp->authentication_mechanism="";
Anyway, to send well-formed messages, it is more recommended to use the SMTP class in conjunction with the smtp_message_class of the MIME message package:
http://www.phpclasses.org/mimemessage |
 ahmet guven | 2007-03-07 03:55:45 - In reply to message 2 from Manuel Lemos |
Thank you for quick reply and perfect script.
I already tried that and there i couldnt do that. Could you send it with full packet with configuration to me ? noisim@gmail.com |
 Manuel Lemos | 2007-03-07 04:18:54 - In reply to message 3 from ahmet guven |
I am not sure what you mean.
If you do what explained above, you only need to install the SASL package in the same directory as your script. Just download that package from http://www.phpclasses.org/sasl .
The smtp_message_class of the MIME message is recommended but not necessary. |
 hamed | 2007-04-28 14:59:34 - In reply to message 4 from Manuel Lemos |
Error: establishing SSL connections requires the OpenSSL extension enabled
$smtp->authentication_mechanism="???"; |
 Manuel Lemos | 2007-04-28 19:13:21 - In reply to message 5 from hamed |
| No, your PHP installation needs to have the OpenSSL extension enabled. It is nothing to do with the class. |
 Roman Wiget | 2007-05-24 15:25:10 - In reply to message 6 from Manuel Lemos |
I tried the whole thing and receive the following error message.
Resolving SMTP server domain "smtp.googlemail.com"...
Connecting to host address "72.14.205.109" port 495...
Cound not send the message to xxx@xxx.ch. Error: could not connect to the host "smtp.googlemail.com": Connection timed out
I did use the SASL Function and OPENSSL is enabled. Anybody has anyhelp? |
 Roman Wiget | 2007-05-24 15:34:51 - In reply to message 7 from Roman Wiget |
| My mistake took the wrong port number. it now works. |
 Manuel Lemos | 2007-05-24 15:36:05 - In reply to message 7 from Roman Wiget |
| Usually that means that outgoing port 465 is blocked in your network firewall. Ask your system administrator to check it out. |
 Neerav Modi | 2007-06-25 16:01:05 - In reply to message 9 from Manuel Lemos |
I have a very similar problem as Ahmet. I have downloaded smtp.php and sasl.php. I will download the MIME message class after I get this working.
I have copied and pasted the sample code you gave. The only difference is the login is username@gmail.com, as that is what Gmail specifies.
Resolving SMTP server domain "smtp.gmail.com"...
Connecting to host address "209.85.133.109" port 465...
Connected to SMTP server "smtp.gmail.com".
S 220 mx.google.com ESMTP b11sm8573458ana
C EHLO localhost
S 250-mx.google.com at your service, [70.87.152.2]
S 250-SIZE 28311552
S 250-8BITMIME
S 250-AUTH LOGIN PLAIN
S 250 ENHANCEDSTATUSCODES
And then nothing else.
Ahmed, what else did you change to get the class to work?
Manuel, please advise on how to proceed. |
|