PHP Classes

SMTP class error

Recommend this page to a friend!

      SMTP E-mail sending class  >  All threads  >  SMTP class error  >  (Un) Subscribe thread alerts  
Subject:SMTP class error
Summary:Error: server does not support starting TLS .
Messages:9
Author:prerna jain
Date:2009-07-17 11:27:10
Update:2009-07-21 07:21:14
 

  1. SMTP class error   Reply   Report abuse  
Picture of prerna jain prerna jain - 2009-07-17 11:27:10
Hi,

I am trying to send mail from my localhost (XAMPP server) using SMTP class..
I am able to send mail using gmail free smtp provider .Where i did the setting as
Host "smtp.gmail.com"
port "465"
Username "My gmail account"
Password "my gmail password"
..
But,when i try to send mail throught the secure SMTP provide to me by some client, i am not able to send mail..
Although i have verified SMTP (using them in outlook setting)credentials provided by client, that those are correct ..
Error message which i am getting is :
Error: server does not support starting TLS .

I have checked all possible settings in php.ini and sendmail.ini.

Please help as i already spent alot time in resolving it.

Thanks in Advance,
prerna

  2. Re: SMTP class error   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2009-07-17 18:13:15 - In reply to message 1 from prerna jain
Look at the output of phpinfo() function and make sure the OpenSSL is installed and enabled.

  3. Re: SMTP class error   Reply   Report abuse  
Picture of prerna jain prerna jain - 2009-07-20 07:50:00 - In reply to message 2 from Manuel Lemos
yes i checked Open SSL is enabled saying:
OpenSSL support enabled
OpenSSL Version OpenSSL 0.9.8g 19 Oct 2007

  4. Re: SMTP class error   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2009-07-20 08:19:49 - In reply to message 3 from prerna jain
Oh, I misread the error message.

The problem is that you are setting the start_tls variable to 1 and Gmail does not support starting TLS after connecting. Just set it to 0.

  5. Re: SMTP class error   Reply   Report abuse  
Picture of prerna jain prerna jain - 2009-07-20 10:32:04 - In reply to message 4 from Manuel Lemos
I am able to send mail through gmail smtp. But when I try to send mail through our company smtp server I am getting the following error message.

Error: server does not support starting TLS .

so I set the start_tls and ssl to 0.But Now I am getting the following
error message.

Error: it is not supported any of the authentication mechanisms required by the server

thanks
prerna

  6. Re: SMTP class error   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2009-07-20 18:38:46 - In reply to message 5 from prerna jain
Different servers need different settings.

The last error message means you specified an user name but it does not require authentication. Just set the user name to an empty string.

  7. Re: SMTP class error   Reply   Report abuse  
Picture of prerna jain prerna jain - 2009-07-21 05:12:43 - In reply to message 6 from Manuel Lemos
Thanks it worked finally.i am able to send mail now..

But mail is going to spam messages ..
Is it some setting required at SMTP server to rectify this,Or the server where script is executing ,or i need to addd some code for this..

  8. Re: SMTP class error   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2009-07-21 06:33:17 - In reply to message 7 from prerna jain
It depends on what you are sending. Common reasons for messages being considered as SPAM is sending an HTML only body. It should always have an alternative text part.

I recommend that you use the MIME message class together with the SMTP class, as it knows how to compose e-mail standards compliant messages, so your messages are not confused with SPAM.

phpclasses.org/mimemessage

Take a look at the slides of this presentation for more reasons to why messages may not reach the destination for being confused with SPAM:

phpclasses.org/browse/video/3/packa ...

  9. Re: SMTP class error   Reply   Report abuse  
Picture of prerna jain prerna jain - 2009-07-21 07:21:15 - In reply to message 8 from Manuel Lemos
Thanks all is fixed from my end and i really appriciate your ontime support.