我有一个注册/登录系统,其中一封带有激活码的电子邮件被发送到注册的电子邮件地址。Outlook.com 收到邮件等等,但由于某种原因 Gmail 没有收到邮件。我不知道为什么。如果有人可以帮助我。
提前致谢
<?php
function send_mail($subject, $to, $text) {
$message = '
<html><body bgcolor="#f0f0f0">
<table width="720" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><font style="font-family:Segoe UI, Arial; color:#0a0a0a;"><h1>Happitual</h1></font></td>
</tr>
<tr>
<td>
<font style="font-family:Segoe UI, Arial; color:#0a0a0a;">
<p>' . $text . '</p>
</font>
</td>
</tr>
<tr>
<td>
<font style="font-family:Segoe UI, Arial; color:#0a0a0a; font-size:12px;">
© All Rights Reserved. Happitual.
</font>
</td>
</tr>
</table>
</body></html>
';
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: Happitual <welcome@happitual.com>' . "\r\n";
// Mail it
mail($to, $subject, $message, $headers);
}
?>