GMail and PHP Swift , PHP Mailler
Moderators: Chris Corbyn, General Moderators
GMail and PHP Swift , PHP Mailler
i config all this in Swift and PHPMailer
- connection : smtp
-is smtp : true
- smtphost : smtp.gmail.com
- port : 25 , 465 or 578
- auth : true
- smtp type , tls and ssl
- user : aaaaa or aaaaa@gmail.com
- pwd : aaaaa
i met alot of error when i try such as STARTTLS first , max time out , fsock open , recipients failed ...
- connection : smtp
-is smtp : true
- smtphost : smtp.gmail.com
- port : 25 , 465 or 578
- auth : true
- smtp type , tls and ssl
- user : aaaaa or aaaaa@gmail.com
- pwd : aaaaa
i met alot of error when i try such as STARTTLS first , max time out , fsock open , recipients failed ...
Last edited by vetola on Wed Jan 05, 2011 6:27 am, edited 1 time in total.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Hi there,
My knowledge of all this is basic at best, but i've been having the same problem as vetola and, after hours of research, came to the conclusion there was no openssl support on my server. Running phpinfo confirmed this (i think, couldn't find mention of openssl).
So, forgive my ignorance, but is this pretty much the end of it then; no openssl no luck?
Also, how reasonable is it of me to push my provider to support it? I mean, is it a big deal getting them to do it, something i should expect to pay for, or is it quite a simple process?
Thanks for your time.
My knowledge of all this is basic at best, but i've been having the same problem as vetola and, after hours of research, came to the conclusion there was no openssl support on my server. Running phpinfo confirmed this (i think, couldn't find mention of openssl).
So, forgive my ignorance, but is this pretty much the end of it then; no openssl no luck?
Also, how reasonable is it of me to push my provider to support it? I mean, is it a big deal getting them to do it, something i should expect to pay for, or is it quite a simple process?
Thanks for your time.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
You should push you provider to support it. OpenSSL is needed for anything which uses the ssl:// and tls:// wrappers.polpol wrote:Hi there,
My knowledge of all this is basic at best, but i've been having the same problem as vetola and, after hours of research, came to the conclusion there was no openssl support on my server. Running phpinfo confirmed this (i think, couldn't find mention of openssl).
So, forgive my ignorance, but is this pretty much the end of it then; no openssl no luck?
Also, how reasonable is it of me to push my provider to support it? I mean, is it a big deal getting them to do it, something i should expect to pay for, or is it quite a simple process?
Thanks for your time.
I reasearched for a long time for ways to support STARTTLS (connect on port 25 unencrypted and then negotiate TLS from within that connection). It's just not viable with PHP since I'd have to write the TLS handling code myself.
Is it a PHP4 or 5 server? What errors do you get?
feyd | Please use
will you test with information above. what's wrong with my code or must i setup any thing else.
does any one already test with gmail and get sending successfully? help me ?
thanks for correct mine.
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
The OpenSSL and its extension dll setup ready. i use IIS . i try to setup php4 and also php5.
when i try to test i meet some error like below :
Error of type [swift_connection_exception] with message [There was a problem reading line 1 of an SMTP response. The response so far was:
Error of type [swift_badresponseexception] with message [Expected response code(s) [250] but got response [530 5.7.0 Must issue a STARTTLS command first j26sm50181waf]]
here is one my test code :Code: Select all
<?php
ini_set("display_errors", true); error_reporting(E_ALL);
require_once "lib/Swift.php";
require_once "lib/Swift/Connection/SMTP.php";
require_once "lib/Swift/Authenticator/LOGIN.php";
$swift =& new Swift(new Swift_Connection_SMTP("smtp.gmail.com",465));
$conn =& new Swift_Connection_SMTP("smtp.gmail.com",465);
$conn->setUsername("vengtola@gmail.com");
$conn->setPassword("test22test");
//$conn->port=465;
//$conn->smtp_type = 'ssl';
//$conn->connection = 'smtp';
//$conn->smtp_host = 'smtp.gmail.com';
//$conn->username = 'vengtola@gmail.com';
//$conn->password = 'test22test';
$msg =& new Swift_Message("Test");
$recipients =& new Swift_RecipientList();
$recipients->addTo("vetola2006@yahoo.com");
if(true==( $swift->send($msg, $recipients, new Swift_Address("vengtola@gmail.com","my name")) ))
echo "sent";
else
echo "errror";
?>does any one already test with gmail and get sending successfully? help me ?
thanks for correct mine.
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Last edited by vetola on Wed Jan 05, 2011 6:31 am, edited 1 time in total.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Hmm, Gmail must have changed their port numbers. Actually, come to think of it, my mail client (Apple Mail) has been unable to connect to Gmail for the past two days so I dropped it and started using my ISP's SMTP. Maybe port 587 will work for you. Gmail has been getting more restrictive on the use of their SMTP server (limitting to 50 emails per half hour or something I think) -- maybe they've dropped support for it entirely.
I'll get back to you when I know more
I'll get back to you when I know more
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Hang on a minute. Someone hasn't read the documentation
Code: Select all
$swift =& new Swift(new Swift_Connection_SMTP("smtp.gmail.com", 465, SWIFT_SMTP_ENC_TLS));Thanks for your answer
I try and test. but i always met the error.
The SMTP connection failed to start tls://smtp.gmail.com , or The SMTP connection failed to start ssl://smtp.gmail.com.
i can not use my php with gmail . i decide to use Outlook Express.
Thanks again.
The SMTP connection failed to start tls://smtp.gmail.com , or The SMTP connection failed to start ssl://smtp.gmail.com.
i can not use my php with gmail . i decide to use Outlook Express.
Thanks again.
Thats a shame.. I have the same problem.d11wtq wrote:I reasearched for a long time for ways to support STARTTLS (connect on port 25 unencrypted and then negotiate TLS from within that connection). It's just not viable with PHP since I'd have to write the TLS handling code myself.
Although OpenSSL seems to be installed on the server there is definitely something wrong with using the ssl:// or tls:// prefixes.
It seems fairly simple to do what you explained above using stream_socket_enable_crypto() in php5[The SMTP connection failed to start [tls://smtp.gmail.com:25]: fsockopen returned Error Number 115 and Error String 'Operation now in progress']
(http://forum.powweb.com/showthread.php?t=73406) .. but doesn't help us people still using php4 :-/