|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /var/www/html/pathumthani_eoffice/ |
Upload File : |
<?
require_once "Mail.php";
//$msg= "MIME-Version: 1.0\r\n";
//$msg .= "Content-type: text/html; charset=Windows-874\r\n";
$msg .= "
<head>
<title> HTML content</title>
</head>
<body>".ereg_replace(chr(13), "<br>", $msgtext)."</body>
</html>
";
$from = 'pudis@sapphire.co.th';
$to = 'sanit@sapphire.co.th';
$subject = ' TEST SMTP MAIL';
$body = ' ทดสอบ ทดสอบ';
$host = "mail.sapphire.co.th";
$username = "epm@sapphire.co.th";
$password = "sapphire";
$content=" text/html; charset=windows-874";
$headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject, 'Content-Type' => $content);
//$headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject);
$smtp = Mail::factory('smtp', array ('host' => $host, 'port' => $port, 'auth' => true, 'username' => $username, 'password' => $password));
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo $mail->getMessage();
}
else {
echo "Message successfully sent!";
}
echo "<pre>$email_from, $subject, $msg, $headers, $refid"; die;
?>