<?php
$jmail =new COM ("Jmail.message") or Die ("Cannot invoke JMail component");
Masking exception errors, silent processing
$jmail->silent=true;
Encoding must be set, otherwise Chinese will be garbled
$jmail->charset= "Utf-8";
Sender e-mail address and name, can be customized, can be different from the mail sending account
$jmail->from= "";
$jmail->fromname= "webmaster";
//Add multiple message Recipients
$jmail->addrecipient ("");
Message subject and body information
$jmail->subject=mb_convert_encoding ($mailtitle, ' GB2312 ', ' UTF-8 ');
$jmail->body= Mb_convert_encoding ($mailcontent, ' GB2312 ', ' UTF-8 ');
//email account and password
$jmail->mailserverusername= "";
$jmail->mailserverpassword= "******";
try{
//Send with SMTP sender server address
$retval = $jmail->send (" Smtp.mail.xxx.com ");
if ($retval)
echo "Send succeeded";
Else
echo "Send Failed";
} catch (Exception $e) {
echo $e->getmessage ();
}
?