-
-
$params = array('host' => 'localhost',
- 'port' => '25',
- 'username' => 'test@jbxue.com',
- 'password' => 'test');
//$to = $test_mail;
- $recipients = $to; 接收人,可以是一个数组来存放多个地址
$headers['From'] = $email;
- $headers['To'] = $to;
- $headers['Subject'] = $subject;
$body = $message;
- //选择smtp的发送方式,当然还支持mail()和sendmail
- $mail_object = &Mail::factory('smtp', $params);
- if (PEAR::isError($e = $mail_object->send($recipients, $headers, $body))) {
- die($e->getMessage() . "n");
- }
- ?>
-
复制代码
|