簡體   English   中英

無法以HTML格式從服務器usiong php郵件發送郵件

[英]unable to send mail from server usiong php mail in html format

我正在嘗試使用php郵件功能發送郵件,它可以與以下代碼配合使用:

<?php
$to = "abhwebdesign@gmail.com";
$subject = "subject";
$password="xxxxx";
$message = "
<html>
<head>
<title>HTML email</title>
</head>
<body >
<div style='width:670px;height:450px;padding:50px;background-color:#EFEFEB;'>
<div style='width:600px;height:450px;background-color:#FFFFFF;color:#105b94;font-size:20px;padding:10px'>
<img src='http://www.example.com/Images/Index/Logo.png' />
<p>Hi,</p>
<table style='color:#105b94;font-size:20px;'>
<tr>
<td><p>Thank you for registering with us.</p></td>
</tr>
<tr>
<td><br>Your password is :$password<br><br>We appreciate your interest.
</td>
</tr>
<tr>
<td><hr>Contact Us <br>Office :9999999999<br>www.example.com
</td>
</tr>
</table>
</div>
</div>
</body>
</html>
";

// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";

// More headers
$headers .= 'From: Support <support@example.com>' . "\r\n";


mail($to,$subject,$message,$headers);
?>

如果我從上述代碼中的“ Office:9999999999 ”行中刪除www.example.com,則該代碼會很好用
www.example.com ”,請幫助我。

我強烈建議您使用: http : //swiftmailer.org/

這包括郵件標題和配置。 它管理所有您不想看到的東西。

親切的問候!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM