2008-4-21 12:47
keenlio
zend_mail 的简单用法
和大家分享zend_mail的用法:
function sendWelcome($user, $email, $pass){
require_once 'Zend/Mail.php';
Zend_Loader :: loadClass('Common');
$mail = new Zend_Mail();
$mail->setFrom('noreply@company.com', "noreply");
$mail->setSubject('We welcome you!');
$mail->setBodyText($user.",\n\n
Welcome! You've just registered at company
with the following information:\n\n
Username: ".$user."\n
Password: ".$pass."\n\n
If you ever lose or forget your password, a new
password will be generated for you and sent to this
email address, if you would like to change your
email address you can do so by going to the
My Account page after signing in.\n\n
- name");
$mail->addTo($email, $user);
$mail->send();
$msgArr[] = "Add new user mail sent!";
Common :: showMessage($msgArr);
}