Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

pear php mail

require_once "Mail.php";
$from = "Sender Name ";
$to = "Recipient Name ";
$subject = " Subject Line Here: ";
$body = " any message you want ";
$host = "yourmailhost.com";
$username = "your username or email";
$password = "your password";
$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("
Source by www.lifewire.com #
 
PREVIOUS NEXT
Tagged: #pear #php #mail
ADD COMMENT
Topic
Name
7+5 =