我使用我自己的send_mail
函数,似乎无法向它传递新行。
我尝试了双引号修复,但它似乎不起作用。调用我的函数时,这些新行可能会丢失?
功能:
abstract class util {
...
static function send_email($to,$from,$subject,$message){
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'To: '.$to.'' . "\r\n";
$headers .= 'From: '.$from.'' . "\r\n";
mail($to, $subject, $message, $headers);
}
...
}
电话:
$subject = "Your email activation for ". DOMAIN;
$message = "Dear ".$this->name.", \r\n Welcome to ********. Click the link below to activate your account and get started. \r\n ".VERIFY_LINK."?code=".$this->code."&id=".$this->id;
util::send_email($this->email, EMAIL_REGISTER, $subject, $message);
然而电子邮件最终总是单行
有任何想法吗?