2010-08-21 70 views

回答

1

你会想从下载Zend框架:http://www.zend.com/community/downloads
你会发这样一封电子邮件:

<?php 
$options = array(
     'auth'  => 'login', 
     'username' => '[email protected]', 
     'password' => '_password_', 
     'ssl'  => 'tls', 
     'port' => 587 
    ); 
    $mailTransport = new Zend_Mail_Transport_Smtp('smtp.gmail.com', $options); 
    Zend_Mail::setDefaultTransport($mailTransport); 

    $m = new Zend_Mail(); 
    $m->addTo('[email protected]'); 
    $m->setFrom('[email protected]', 'Sender name'); 
    $m->setSubject('Using Gmail SMTP'); 
    $m->setBodyText('Hello! I am using Gmail from the localhost :)'); 
    $m->send();