note 79164 added to ref.mail
| From: | brandon at jhpprojects dot com dot au | Date: | Wed, 14 Nov 2007 05:03:39 +0000 |
| Subject: | note 79164 added to ref.mail | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-132249@lists.php.net to get a copy of this message | ||
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
----
Server IP: 203.220.0.234
Probable Submitter: 61.8.14.18
----
Manual Page -- http://www.php.net/manual/en/ref.mail.php
Edit -- https://master.php.net/note/edit/79164
Del: integrated -- https://master.php.net/note/delete/79164/integrated
Del: useless -- https://master.php.net/note/delete/79164/useless
Del: bad code -- https://master.php.net/note/delete/79164/bad+code
Del: spam -- https://master.php.net/note/delete/79164/spam
Del: non-english -- https://master.php.net/note/delete/79164/non-english
Del: in docs -- https://master.php.net/note/delete/79164/in+docs
Del: other reasons-- https://master.php.net/note/delete/79164
Reject -- https://master.php.net/note/reject/79164
Search -- https://master.php.net/manage/user-notes.php