doulu1907 2016-08-07 14:50 采纳率: 100%
浏览 81
已采纳

如何使用BOOTSTRAP格式在PHP中发送HTML邮件

What's the best way to construct and send an HTML email using mail()with bootstrap formatting? I've tried the following example (not full code):

$msg = "
<html>
<head>
<link href = '//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css' rel='stylesheet' type='text/css'>
</head>
<body>
<p>This is a request to reset your password</p>
<a href='blah'>Click here to reset your password.</a>
<button type='submit' class='btn btn-info btn-sm'>Reset</button>
</body>
</html>
";
$headers = "MIME-Version: 1.0" . "
";
$headers .= "Content-type:text/html; charset=iso-8859-1"."
"; "X-Mailer: php".
$headers .= 'From: Password Reset <passwordreset@blah.co.uk>' . "
";

The mail sends and is received in html but not formatted.

  • 写回答

1条回答 默认 最新

  • duanniling0018 2016-08-07 14:53
    关注

    Unless you put all of the bootstrap code directly in your email, no. Email clients remove remote files by default to prevent user tracking. You cannot code around this.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 手机连接电脑热点显示无ip分配
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大