-
-
$params = array('host' => 'localhost',
- 'port' => '25',
- 'username' => 'test @jbxue.com',
- 'password' => 'test');
//$to = $test_mail;
- $recipients = $to; Recipient, can be an array To store multiple addresses
$headers['From'] = $email;
- $headers['To'] = $to;
- $headers['Subject'] = $subject;
$body = $message;
- //Select the smtp sending method, of course, mail() and sendmail are also supported
- $mail_object = &Mail::factory('smtp', $params);
- if (PEAR::isError($e = $mail_object->send($recipients, $headers, $body))) {
- die($e->getMessage() . "n");
- }
- ?>
-
Copy code
|