这个功能我以前写了, 测试成功了, html格式的, 但是后来因为一些原因换了个主机(还是同一个公司), 然后再测试, 他邮件的页面上就直接显示我那些html代码了, 像
<html><style type='text/css'>
<!--
.text1{
font-family:Tahoma,Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
color:#0e8a83;
}
a.link1{
font-family
大家觉得, 是不是他那个主机少安装了什么支持阿?我的代码是:
<?php
function email_register($email, $name, $password){
$_toEmailAddress = $email; $_subject = "Pa.com";
$_from = "[email protected]";
if ( $_POST[ "cc_me" ] == "on" ) {
$_ccEmailAddress = $_from;
}
$url = "http://www.pa.com";
$message ="<html><style type='text/css'>.......略去html"; $message =$message."Hi,".$name.":<br/>";
$message =$message."<br/>You successfully registered on <a href=$url class='link1'>$url</a> <br/>Your password is : ";
$message =$message. $password . "<br/>";
$message =$message."Please enjoy your service here. <br/>";
$message =$message."<br/>Pa Staff";
$_headers = "";
//$_headers .= "MIME-Version: 1.0rn";
//$_headers .= "Content-type: text/html; charset=iso-8859-1rn";
$_headers .= "From: $_fromrn";
//$_headers .= "To: ".$_toEmailAddress."rn";
if (! empty($_bccEmailAddress) ) {
$_headers .= "BCC: ".$_bccEmailAddress."rn";
}
if (! empty($_ccEmailAddress) ) {
$_headers .= "CC: ".$_ccEmailAddress."rn";
}
// $message = htmlentities($message);
$mailresponse = mail("$_toEmailAddress",
"$_subject",
"$message",
$_headers
);
}
?>
<html><style type='text/css'>
<!--
.text1{
font-family:Tahoma,Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
color:#0e8a83;
}
a.link1{
font-family
大家觉得, 是不是他那个主机少安装了什么支持阿?我的代码是:
<?php
function email_register($email, $name, $password){
$_toEmailAddress = $email; $_subject = "Pa.com";
$_from = "[email protected]";
if ( $_POST[ "cc_me" ] == "on" ) {
$_ccEmailAddress = $_from;
}
$url = "http://www.pa.com";
$message ="<html><style type='text/css'>.......略去html"; $message =$message."Hi,".$name.":<br/>";
$message =$message."<br/>You successfully registered on <a href=$url class='link1'>$url</a> <br/>Your password is : ";
$message =$message. $password . "<br/>";
$message =$message."Please enjoy your service here. <br/>";
$message =$message."<br/>Pa Staff";
$_headers = "";
//$_headers .= "MIME-Version: 1.0rn";
//$_headers .= "Content-type: text/html; charset=iso-8859-1rn";
$_headers .= "From: $_fromrn";
//$_headers .= "To: ".$_toEmailAddress."rn";
if (! empty($_bccEmailAddress) ) {
$_headers .= "BCC: ".$_bccEmailAddress."rn";
}
if (! empty($_ccEmailAddress) ) {
$_headers .= "CC: ".$_ccEmailAddress."rn";
}
// $message = htmlentities($message);
$mailresponse = mail("$_toEmailAddress",
"$_subject",
"$message",
$_headers
);
}
?>
$message ="<html><style type='text/css'>.......里面的要加 \ 进行转义