Page 1 of 1

Swiftmailer Gmail and error type 2

Posted: Sun Oct 08, 2006 3:15 am
by ollip1
Weirdan | 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]


I use Swift and Google's gmail as a smtp server. I can send emails but get an error:

Code: Select all

Sun, 08 Oct 2006 10:56:54 +0300; fgets() [function.fgets]: SSL: fatal protocol error (error type 2 in /home/hyperpol/public_html/missionangels/swift/Swift.php on line 851) [context: Array]
I didn't see the error without using "clsErrorHandle" class.
This is exacly the place where the error comes in Swift.php:

Code: Select all

function getResponse()
	{
		if (!$this->connection->readHook || !$this->isConnected()) return false;
		$ret = "";
		while (true)
		{
			$tmp = @fgets($this->connection->readHook);
It seems that it can't read the right place of memory.
Can anybody help?


Weirdan | 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]

Posted: Sun Oct 08, 2006 9:02 am
by Chris Corbyn
How are you connecting? Are you using SWIFT_SECURE_PORT as the port? It sounds like it's trying to use TLS on the wrong port.

Connecting to the Gmail

Posted: Sun Oct 08, 2006 9:30 am
by ollip1
I am connecting like this:

Code: Select all

$swift = new Swift(new Swift_Connection_SMTP('smtp.gmail.com', SWIFT_SECURE_PORT, SWIFT_TLS));
	//Log in to the server
	$swift->authenticate('myemail@gmail.com', 'password');
And it really sends the email. It seems that this error does not prohibit that but maybe does not read from the SMTP server over SSL.

Posted: Sun Oct 08, 2006 5:19 pm
by Chris Corbyn
/me ponders if the connection is being dropped upon QUIT being called and before sending a 250 OK response. I'll patch something into the code and see if it helps.

I should post back tomorrow.