views:

1197

answers:

2

So I'm under the impression that bad things will happen if I don't use Zend_Mail_Transport_Smtp when sending lots of emails. Problem is...I can't figure out how to set it up. I host my website through DreamHost, and have my email (and other domain specific apps) through google. So to access my email, I go to mail.mydomain.com, which takes me to a google login page.

This is the code that I am using, but it's not working.

$config = array('ssl' => 'tls', 'port' => 587, 'auth' => 'login', 'username' => '[email protected]', 'password' => 'password');
$smtpConnection = new Zend_Mail_Transport_Smtp('mail.mydomain.com', $config);
  • Using "mail.mydomain.com" I get a "connection timed out" error (which makes me think its the wrong thing to use.
  • Using "smtp.mydomain.com" I get a "Could not open socket" error.

Where am I going wrong? Do I really need to use Zend_Mail_Transport_Smtp?

+1  A: 

Since you are sending emails through gmail, you should use "smtp.gmail.com" and not your domain.

$config = array('ssl' => 'tls', 'port' => 587, 'auth' => 'login', 'username' => '[email protected]', 'password' => 'password');
$smtpConnection = new Zend_Mail_Transport_Smtp('smtp.gmail.com', $config);
Andrew
A: 

Thanks! This post help me !

I have one problem with encode (utf-8 and iso-8859-1) messages. Does this class have some funciton that can solve this problem ?

Ex:This is the email output. Original: Este é o conteúdo do email em Html.

Este é o conteúdo do email em Html.

you should post this as your own question and see if someone has an answer for you, rather than posting it as an answer since it is harder to be found.
Andrew