我無法發送郵件的HTML格式PHP的mail()不能查看HTML
$to=$email;
$obj='verify mail firstdj.eu';
$message="<html><head><title>Email confirm</title></head><body><table style='width: 100%;max-width: 600px;margin-left: 50%;transform: translateX(-50%);'><tr><th style='text-align: -webkit-center !important;text-align: -moz-center !important;text-align:center;'><div style='position: relative;box-shadow: black 0px 2px 3px;letter-spacing: 1px;width: 100%;max-width: 550px;height:180px;background-color:#3B2C6C;color:white;border: 1px solid #8F8787; '><img src='./img/logoEmail.png'><img src='./sito/party.png' style='width: 100%;height: 50px;position:absolute; bottom:0px;left:0px;'></div></th></tr><tr><td style='text-align: -webkit-center !important;text-align: -moz-center !important;text-align:center;'><div style='width: 100%; max-width: 550px;border: 5px solid #3B2C6C;box-sizing: border-box;text-align:left'><div style='padding:7px;font-family: arial,sans-serif;font-size: 15px;'>hi marco,<br><br>thanks for choosing us now,<br>to complete your signing up click <a href='verify_email.php?name=marco'>here</a></div></div></td></tr></table></body></html>";
$header='From: Thorny_firstdj.eu<[email protected]>'.'\r\n';
$header .= 'MIME-Version: 1.0'.'\r\n';
$header .='Content-Type: text/html; charset=ISO-8859-1'.'\r\n';
$emailCon=mail($to,$obj,$message,$header);
我住進了php.ini中的mail.add_x_header爲ON。 我在哪裏做錯了?
這是你的報價在標題,最有可能的。那些不會被單引號解析。 RTM http://php.net/manual/en/function.mail.php',「\ r \ n」);' –
也許是因爲行不應該大於70個字符? – thorny84
我懷疑這一點。如果有的話,你會得到部分消息。 –