我正在尝试通过 PHP mail() 函数将样式信息与电子邮件一起发送。不幸的是,即使我的邮件客户端设置为接受样式化的电子邮件,它仍然只是呈现为纯 html 文本。
$to = $email;
$subject = "Subject Details";
$message='<html><body><table width="600" height="840" border="0" cellpadding="5" cellspacing="5">';
$message.='<tr><td height="110"><img src="https://user.co.uk/images/logo.jpg" alt="SignDox" width="300" height="100" /></td></tr>';
$message.='<tr><td height="29" bgcolor="#5C1561"> </td></tr>';
$message.='<tr><td height="537" valign="top">';
$message.="Message Goes Here\n\n";
$message.="Username: ".$new_agent_id."\n";
$message.="Password: ".$pass1."\n\n";
$message.="To sign in to your user panel follow this link: \n";
$message.="Inside your admin section you will be able to change your username and password.\n";
$message.='</td></tr>';
$message.='<tr><td height="140" bgcolor="#5C1561"> </td></tr></table></body></html>';
$from = "no-reply@sender.co.uk";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);