note 79164 deleted from ref.mail by danbrown
| From: | danbrown@php.net | Date: | Sun, 17 May 2009 20:04:21 +0000 |
| Subject: | note 79164 deleted from ref.mail by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-155322@lists.php.net to get a copy of this message | ||
Note Submitter: brandon at jhpprojects dot com dot au
----
Sending Email using PHP from Godaddy host
Hi guys this is what you have to use.
You need to use Pear thats already included on the godaddy hosting and then inlcude the mail.php
Here is a function to help you: This will even allow you to send html emails
require_once "Mail.php";
function emailHtml($from, $subject, $message, $to) {
$host = "localhost";
$username = "";
$password = "";
$headers = array ('MIME-Version' => "1.0", 'Content-type' =>
"text/html; charset=iso-8859-1;", 'From' => $from, 'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp', array ('host' => $host, 'auth' =>
false));
$mail = $smtp->send($to, $headers, $message);
if (PEAR::isError($mail))
return 0;
else
return 1;
}
Have fun
Brandon Tapera