我正在向gmail帐户发送电子邮件。该消息有一个链接。我希望链接不会显示出来。下面是消息的一部分。Gmail会按原样显示这个部分,但我希望gmail显示为Please ***click here*** to upload your application form.
Please <a href='http://www.mywebsite.com'>click here </a> to upload your application form.
谢谢。
发布于 2018-06-06 12:13:30
这里的问题可能是因为缺少内容类型的标头。请看下面的示例:
$to = 'test@test.com';
$subject = 'PHP Mail Sending';
$headers = "From: scripts@email.com \r\n";
$headers .= "Reply-To: no-reply@email.com \r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=UTF-8\r\n";
$message = '<p>Hello, this is to check PHP mail function</p>';
mail($to, $subject, $message, $headers);
在上面的代码中,行$headers .= "Content-Type: text/html; charset=UTF-8\r\n";
告诉邮件发送者和收件人电子邮件包含的是格式良好的HTML
发布于 2018-06-06 11:50:30
在发送邮件之前,请确保已将邮件格式选择为HTML。你可以根据你自己的平台找到它。
https://stackoverflow.com/questions/50710340
复制相似问题