Topics:
DVR
nvrec
Mplayer
Links
Misc
Commands
Humor
New user
uploaded files
|
(linux_command_line)-> (Parent)->sendmail from php (mosso/rackspace) |
submited by Russell Fri 10 Sep 10 Edited Tue 14 Feb 12 |
php example to send mail from rackspace cloud This is good because it does a check for email validity before it sends.
How_do_I_test_PHP_SMTP_functionality (new link to same file)
In case I can't find it next time It is pasted Below: WARNING THE < and > codes will not render corectly, use view source and copy
-----cut here-----
";
$to = "Nobody ";
$subject = "Test email using PHP SMTP\r\n\r\n";
$body = "This is a test email message";
$host = "mail.emailsrvr.com";
$username = "webmaster@example.com";
$password = "yourPassword";
$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("" . $mail->getMessage() . " ");
} else {
echo("Message successfully sent! ");
}
?>
----cut-here----
|
Add comment or question...:
|