Gmail Error - MTA Failed - authentication not supported

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
taylorlee
Forum Newbie
Posts: 7
Joined: Thu Dec 07, 2006 1:03 am

Gmail Error - MTA Failed - authentication not supported

Post by taylorlee »

Hello,

I am using the standard script for relaying through Gmail

Code: Select all

$swift = new Swift(new Swift_Connection_SMTP('smtp.gmail.com', SWIFT_SECURE_PORT, SWIFT_TLS));
 $swift->authenticate('me@gmail.com', 'pw');

This is the error I receive through print_r:

Array ( [0] => Array ( [num] => 0 [time] => 0.73205300 1165474322 [message] => Connection to the given MTA failed. The Connection Interface said: Success ) [1] => Array ( [num] => 0 [time] => 0.73526900 1165474322 [message] => The MTA doesn't support any of Swift's loaded authentication mechanisms ) ) Array ( )


I'm using 2.1.17 for php4 - under version php 4.4.0

I tried this on my local server as well as a hosted server and I get the same error.
Also, I'm in South Korea if that makes a difference. But I also tried another server not based in Korea and it did not work either.

Any help would be GREATLY appreciated. If you need any more info, I will reply asap.

Thanks in advance.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

What's in $swift->transactions if you print_r() that?

Did you copy any files out of the Swift directory?
taylorlee
Forum Newbie
Posts: 7
Joined: Thu Dec 07, 2006 1:03 am

Post by taylorlee »

$swift->transactions returns an empty array
taylorlee
Forum Newbie
Posts: 7
Joined: Thu Dec 07, 2006 1:03 am

Post by taylorlee »

I didn't handle the files at all.. just copied them ..

I created a new directory called "swiftmailer" and copied them..

and then I ran my test script in the docs/examples folder..

required files loaded okay..

Thanks... do u need any more info?
taylorlee
Forum Newbie
Posts: 7
Joined: Thu Dec 07, 2006 1:03 am

Post by taylorlee »

Hi,

This is an update. It seems that it works fine on the server not located in Korea. However, I still get the same error from both my local server and the server located in Korea.

Could it be a language/encoding issue?
taylorlee
Forum Newbie
Posts: 7
Joined: Thu Dec 07, 2006 1:03 am

Post by taylorlee »

Another update:

I didn't think I needed OpenSSL.

Do I need this enabled in my php? Because I don't. Is that the problem?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

PHP needs to be compiled with OpenSSL or SSL and TLS connections will not work.

However, I have a sneaky suspicion that your connection is being dropped before it gets that far. Is this on a web host?
taylorlee
Forum Newbie
Posts: 7
Joined: Thu Dec 07, 2006 1:03 am

Post by taylorlee »

It is a web host.

But I'm testing it on my local server as well as another web host where it does work.

Well, if I don't have Open SSL, would that cause the same problem? I will try to install Open SSL, which seems harder than I thought... ? Because I need to re-install PHP on my Windows system..? I added the extension files but PHP still isn't recognizing and saying it's not the proper "build" which suggests I can't just drop in the openssl files and change my php.ini..? I'm adding question marks because I have no idea. Who knew sending one Gmail email through php would be so difficult.

Because I tried another program that uses Open ssl to do the same thing (actually a modification of phpmailer) but php is still compaining that I have no ssl support in this build even though phpinfo() shows it is there.

So.. it seems my only option at this point is to re-install PHP and make sure that the proper extensions are "built" in (whatever that means) and hopefully then the open ssl extension will be recognized.. Then I'll try swiftmailer again and let u know.

Thanks again for your help!
taylorlee
Forum Newbie
Posts: 7
Joined: Thu Dec 07, 2006 1:03 am

Post by taylorlee »

Hi,

The problem has been solved.

The problem was that my php version did not support ssl as a valid stream.

So in order for everything to work, needed Open SSL + https as a valid stream.

So good lesson learned ....

Thanks again for your help.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

No problem. For tls:// ssl:// streams to operate OpenSSL provides the encryption/decryption. It would be too expensive to implement purely in PHP. I looked into it and it's just not worth it :)
Post Reply