if you want to send email with gmail (public/google apps) through smtp, use
this:
 $config = array('auth' => 'login',
                    'username' => '[EMAIL PROTECTED]',
                    'password' => 'mypassword',
                    'ssl' => 'ssl'
                );
                $transport = new Zend_Mail_Transport_Smtp('smtp.gmail.com',
$config);
                $mail = new Zend_Mail();
                $mail->addTo('[EMAIL PROTECTED]', 'recipient name');
                $mail->setFrom('[EMAIL PROTECTED]', 'my name');
                $mail->setSubject('the subject');
                $mail->setBodyText("the content of email");
                $mail->send($transport);

regards,
Riki Risnandar

On Thu, Jun 26, 2008 at 8:29 PM, holografix . <[EMAIL PROTECTED]> wrote:

> Hi
>
> try this way:
>
> $authDetails = array(
>                'tls',
>                'port' => 465,
>                'auth' => 'login',
>                'username' => '[EMAIL PROTECTED]',
>                'password' => 'xxxxxxx'
>        );
>
> Regards
>
> 2008/6/26 robsg <[EMAIL PROTECTED]>:
>
>
>> thanks for help, but i stil can't send mail,
>> maybe i'm stupid, but i don't know what is wrong.
>> i get the same error then before
>>
>> try {
>>        $authDetails = array(
>>                'ssl' => 'tls',
>>                'port' => 587,  //or 465
>>                'auth' => 'login',
>>                'username' => '[EMAIL PROTECTED]',
>>                'password' => 'xxxxxxx'
>>        );
>>        $transport = new Zend_Mail_Transport_Smtp('smtp.gmail.com',
>> $authDetails);
>>        Zend_Mail::setDefaultTransport($transport);
>>
>>        $mail = new Zend_Mail();
>>        $mail->setBodyText('This is the text of the mail.');
>>        $mail->setFrom('[EMAIL PROTECTED]', 'Some Sender');
>>        $mail->addTo('[EMAIL PROTECTED]', 'Some Recipient');
>>        $mail->setSubject('TestSubject');
>>        $mail->send();
>>
>>        } catch (Zend_Exception $e) {
>>        echo $e->getMessage(); exit;
>> }
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Whay-i-can%27t-send-mail-with-zend_mail----tp18090664p18133427.html
>> Sent from the Zend Framework mailing list archive at Nabble.com.
>>
>>
>

Reply via email to