我正在撰写有关如何向PHP电子邮件添加样式的文章。一切正常,但一旦我添加我的徽标就停止工作。但是,如果我添加他们的例子,它可以工作......
他们的图片示例:<img src="//css-tricks.com/examples/WebsiteChangeRequestForm/images/wcrf-header.png" alt="Website Change Request" />
我的图片:<img src="//starlightradio.co.uk/images/email-logo.png" alt="Sea Match Rigs - Official Website" />
但由于某种原因,它确实不想工作。电子邮件只是没有与此图像一起发送。
这是我的整个代码页:
<?php
$to = 'sam.carre2000@gmail.com';
$subject = 'Sea Match Rigs - Password Reset Link';
$headers = "From: noreply@seamatchrigs.co.uk\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$message = '<html>
<div style="width:500px;margin:0 auto;margin-bottom:20px;margin-top:40px;"><img src="//starlightradio.co.uk/images/email-logo.png" alt="Sea Match Rigs - Official Website" /></div>
<head><link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"></head>
<body style="background-color:#2F8982;padding-top:50px;padding-bottom:50px;">
<div style="font-family:Open Sans, sans-serif;">
<div style="height:300px;width:500px;border:1px solid #ccc;border-radius:3px;padding:20px;margin:0 auto;background-color:#fff;">
<div style="color:#349891;font-weight:bold;font-size:25px;text-align:center;">Password Reset Details</div>
<div style="border-bottom:1px solid #349891;margin:0 auto;margin-top:15px;margin-bottom:15px;width:50%;"></div>
<div style="color:#000;font-size:20px;margin-top:10px;text-align:center;">It seems that you have requested to reset your password on <a href="http://seamatchrigs.co.uk" style="color:#000;text-decoration:none;"><b>seamatchrigs.co.uk</b></a>. <div style="color:#FFA500;margin-top:30px;">Please click the button below to reset your password on your account.</div>
<a href=""><div style="height:30px;width:200px;display:inline-block;border:1px solid #349891;color:#349891;padding:20px;border-radius:3px;margin-top:20px;">Click Here</div></a>
</div></body></html>';
mail($to, $subject, $message, $headers);
echo $message;
?>