|
本帖最后由 ynishop 于 2011-5-27 23:22 编辑
我的主机支持Jmail邮件协议,但不知道怎么修改让主机可以发邮件。。。。。也就是php 里调用JMAIL。求救。。。。。。
帮我看下怎么把以下发邮件代码嵌入到 \catalog\controller\account\create.php文件里?
<?
header("Content-Type:text/html;");
function TOJMail($From,$FromName,$FromUser,$FromPass,$TOMail,$TOTitle,$TOContent,$SmtpServer)
{
$jmail=new COM("JMail.Message")or die("Jmail");
$jmail->logging="true";
$jmail->Charset = 'gb2312'; //Ļ
$jmail->ContentTransferEncoding = "base64";
$jmail->Encoding = "base64";
$jmail->ISOEncodeHeaders = true;
$jmail->From=$From;
$jmail->FromName=$FromName;
$jmail->AddRecipient($TOMail);
$jmail->Subject=$TOTitle;
$jmail->Body=$TOContent;
$jmail->MailServerUserName=$FromUser;
$jmail->MailServerPassword=$FromPass;
$jmail->Send($SmtpServer);
echo "发送成功";
}
$From = "nrsrlove@126.com"; //发件人
$FromName = "test"; //发件人名字
$FromUser = "nrsrlove"; //SMTP帐户名
$FromPass = "*****"; //SMTP密码
$TOMail = "ynishop@126.com"; //收件人
$TOTitle = "PHP+JmailԷʼ"; //ʼ 邮件主题
$TOContent = "PHP+JmailԷʼ"; //邮件内容
$SmtpServer = "smtp.126.com"; //ʼ SMTP主机
TOJMail($From,$FromName,$FromUser,$FromPass,$TOMail,$TOTitle,$TOContent,$SmtpServer);
?>
.
|
|