Re: Re: [PEAR] PEAR mail problem
| From: | mandar.b | Date: | Sun, 27 Apr 2008 17:00:15 +0000 |
| Subject: | Re: Re: [PEAR] PEAR mail problem | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-28838@lists.php.net to get a copy of this message | ||
Hi,
I am also facing similar problem.
Following is my script. I found that send method fails.
Please help me to solve this issue.
<?php
require_once "../PEAR/Mail.php";
$from = "Daniel <info@crewnewmexico.com>";
$to = "Mandar <mandar.b@codewalla.com>";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
$host = "mail.secureserver.net";
$username = "info@crewnewmexico.com";
$password = "spicyrice";
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => true,
'username' => $username,
'password' => $password));
$mail = $smtp->send($to, $headers, $body) ;
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {
echo("<p>Message successfully sent!</p>");
}
?>
--
View this message in context: http://www.nabble.com/PEAR-mail-problem-tp15889269p16925832.html
Sent from the Pear - General mailing list archive at Nabble.com.