我希望格式化我的邮件:字体颜色,大小等。所以这里有stackoverflow和我发现的很多地方,必须添加$mail->IsHTML(true);
以应用任何内联归因。
由于我的知识不足,我无法理解如何以及在哪里将我的php邮件添加到此行。
这是邮件:
<?
class Mailer
{
function sendWelcome($user, $email, $pass, $evcode){
$from = "From: ".EMAIL_FROM_NAME." <".EMAIL_FROM_ADDR.">";
$subject = "Welcome!";
if($session->$userlevel == 1){ $emailline = "You need to verify the link below\n"
.SCRIPT_LOCATION."/mail.php?verify=".$evcode."\n\n";
} else { $emailline = "\n";}
$emailline = "Before you can start verify the link \n"
.SCRIPT_LOCATION."/mail.php?verify=".$evcode."\n\n";
$body = $user.",\n\n"
."Welcome! You've just registered at us "
."Username: ".$user."\n"
."Password: ".$pass."\n".
$emailline
."N.B.: THIS VERIFICATION VALID ONLY FOR 7 DAYS\n"
."Thank you";
return mail($email,$subject,$body,$from);
}
};
/* Initialize mailer object */
$mailer = new Mailer;
?>