输入banner图图片脚本导航/分类

php使用Pear的NetMail发送smtp邮件

  1. $params = array('host' => 'localhost',

  2. 'port' => '25',
  3. 'username' => 'test@jbxue.com',
  4. 'password' => 'test');

  5. //$to = $test_mail;

  6. $recipients = $to; 接收人,可以是一个数组来存放多个地址

  7. $headers['From'] = $email;

  8. $headers['To'] = $to;
  9. $headers['Subject'] = $subject;

  10. $body = $message;

  11. //选择smtp的发送方式,当然还支持mail()和sendmail
  12. $mail_object = &Mail::factory('smtp', $params);
  13. if (PEAR::isError($e = $mail_object->send($recipients, $headers, $body))) {
  14. die($e->getMessage() . "\n");
  15. }
  16. ?>