Everyone knows that Zend Framework is a standard PHP5 version of the framework developed by zend Company. It includes almost the functional modules we often use, such as feed, mail, cache, db, etc. Today we will mainly introduce it. The Zend_Mail module helps us send application information to administrators and customers in a timely manner.
The following is a code block I wrote. This code is to send emails through SMTP. You need to provide a username, password and host address. This is also the email login method we often use.
require_once Zend/Mail.php;
require_once Zend/Mail/Transport/Smtp.php;
class logMail {
private static $_config=array(auth=>login,
username=>XXXX@yuyu.com,
password=>XXXX);
private static $_mail = null;
private static $_transport = null;
public function __construct($ title, $body){
yuyu.com,self::$_config);
new Zend_Mail();
$mail->setBodyText($body);
$mail->setFrom(XXX@yuyu.com, XXX);
$mail->addTo(XXX@ 163.com, XXX);
$mail->setSubject($title.(.$shijie.));
$mail->send($transport); return true;
}catch(Exception $e) }
return false; title, $body) {
using new logMail(Test,Test);
Through the above code, you only need to change the username and password to your own, and you can use them in the application at will. There may be more important applications. It’s the sending of logs and the sending of projects!
http://www.bkjia.com/PHPjc/486061.html
www.bkjia.com
true
http: //www.bkjia.com/PHPjc/486061.html
TechArticle
Everyone knows that Zend Framework is a standard PHP5 version of the framework developed by zend Company. It includes Almost the functional modules we often use, such as feed, mail, cache, db, etc.,...