我创建了一个程序,用于发送带有自定义html格式的电子邮件,其中包含一些用户日期和一些预先写好的文本。
我们不会发送电子邮件,也不知道原因。这是代码:
$to = $_SESSION['email'];
$subject = 'Possword recovery';
$message = '<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" style="width:800px; background-color:#EEE; border:solid 1px #DDD; padding:10px;" align="center">
<thead>
<tr>
<td style="padding:10px; vertical-align:middle; height:150px; background-color:#00247D; width:60%;">
<img src="http://www.welovegreatbritain.com/email/images/logo.png">
</td>
<td style="vertical-align:middle; background-color:#900; width:40%; color:#FFF; font-family:Arial, Helvetica, sans-serif;">
<span style="font-size:12px; margin-left:30px; display:block; text-decoration:underline;">Contact Us </span>
<span style="font-size:10px; margin-left:30px; display:block; margin-top:4px;">0844-414-8582</span>
<span style="font-size:10px; margin-left:30px; display:block; margin-top:1px;">0871-288-5127</span>
<p style="margin-left:30px; margin-right:15px;">
<b style="font-size:12px;">NOTE : </b>
<span style="font-size:10px;"> If you are calling from outside UK please dial 0044 0844 414 8582 or 0044 0844 288 5127</span>
</p>
</td>
</tr>
</thead>
<tbody>
<tr>
<td colspan="2" style="background-color:#FFF; height:600px; padding:10px; vertical-align:top; font-family:Arial, Helvetica, sans-serif;">
<h2 style="font-weight:normal; font-size:17px; color:#00247D; margin-top:25px; margin-left:25px;">Password Recovery</h2>
<p style="margin-left:25px; font-size:16px;">
Hi, we just notice that you have attampted a password recovery from the below location.
<span style="display:block; font-size:12px; margin-top:10px;">Country : <span style="margin-left:25px;">'.$country.'</span></span>
<span style="display:block; font-size:12px;">City : <span style="margin-left:47px;">'.$client_city.'</span></span>
<span style="display:block; font-size:12px;">Browser : <span style="margin-left:21px;">'.$browser.'</span></span>
<span style="display:block; font-size:12px;">OS : <span style="margin-left:50px;">'.$os.'?></span></span>
<span style="display:block; font-size:12px;">IP : <span style="margin-left:55px;">'.$client_ip.'</span></span>
</p>
<p style="margin-left:25px; margin-top:50px;">
<span style="font-size:25px;">
Cancer Research UK
</span>
</p>
<p style="margin-left:25px;">
Join our 10 minute surevy and save a life. <a href="#">Click Here</a> to join now.
<span style="display:block;">
Nothing is complecate on this surevy. You just have to answer 10 simple qustions and can save a life.
</span>
</p>
<p style="margin-left:25px; margin-top:60px;">
Thanks
<span style="display:block">James Cosgrove</span>
</p>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td style="vertical-align:top; padding:5px 0 0 0; color:#666; font-size:12px; border-top:solid 1px #DDD;">
<span>Maximum SRJ | </span> © 2014
<span style="display:block; font-size:12px;">
Director : James Cosgrove
</span>
<span style="display:block; font-size:12px;">
Email : cosgrove@welovegreatbritain.com
</span>
<span style="display:block;font-size:12px;">
Address : BT Street, London, 401523, UK
</span>
<span>
<a href="#">Terms & Condition</a>
</span>
<span style="color:#000; font-weight:bold">|</span>
<span>
<a href="#">Privacy</a>
</span>
<span style="color:#000; font-weight:bold">|</span>
<span>
All Rights Reserved
</span>
</td>
<td style="padding:0 0 0 0; vertical-align:top; text-align:right; border-top:solid 1px #DDD;">
<img src="http://www.welovegreatbritain.com/email/images/flogo.png" style="margin-top:5px;" />
</td>
</tr>
</tfoot>
</table>
</td>
</tr>
</table>
';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: Welove Great Britain <no-reply@welovegreatbritain.com>' . "\r\n";
mail($to, $subject, $message, $headers);
此外,它没有显示任何类型的错误消息。与此页面相关的其他功能,如将一些用户日期存储到mysql表中也可以正常工作。
所以,有人请帮我解决这些麻烦。我真的很感谢你。
答案 0 :(得分:0)
尝试在php.ini中启用扩展程序。 Maby SMTP概述为“;”登录。