Swiftmailer Gmail and error type 2

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
ollip1
Forum Newbie
Posts: 6
Joined: Sun Oct 08, 2006 3:11 am

Swiftmailer Gmail and error type 2

Post 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]
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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.
ollip1
Forum Newbie
Posts: 6
Joined: Sun Oct 08, 2006 3:11 am

Connecting to the Gmail

Post 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.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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.
Post Reply