-4 php
我需要帮助.我的脚本发送电子邮件,但忽略了html标签.任何人都可以帮我这个吗?
我的代码在这里:
$to = "email@example.com";
$subject = 'Povolenie užívate?a';
$message = '<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<body>
Užívate? ?aká na vaše schválenie.<br>Meno:$meno <br> Priezvisko:$priezvisko <br>
Firma:$firma<br>
E-mail:$email <br> V prípade ak chcete užívate?a povoli? kliknite na tento odkaz:
<a href="http://website.com/povolenie.php?r=$ret&povolenie=1" target="blank">povoli?</a> <br>
Ak ho povoli? nechcete tak kliknite na tento odkaz:
<a href="http://website.com/povolenie.php?r=$ret&povolenie=0" target="blank">zakáza?</a>"
</body>
</html>';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; Charset=Windows-1250' ."\r\n";
$headers = 'From: XXX<email@example.com>' . "\r\n" .
"CC: email@example.com";
mail($to, $subject, $message, $headers);
Run Code Online (Sandbox Code Playgroud)
您的最后一个标题已损坏,缺少连接(句点).
$headers = 'From: XYZ <email@example.com>' . "\r\n" .
"CC: email@example.com";
Run Code Online (Sandbox Code Playgroud)
添加句点/点
$headers .= 'From:...
^ right there
Run Code Online (Sandbox Code Playgroud)
做:
$headers .= 'From: XYZ <email@example.com>' . "\r\n" .
"CC: email@example.com";
Run Code Online (Sandbox Code Playgroud)