Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/string/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP邮件-在html邮件中使用PHP字符串_Php_String - Fatal编程技术网

PHP邮件-在html邮件中使用PHP字符串

PHP邮件-在html邮件中使用PHP字符串,php,string,Php,String,这是我的代码: $to='1!'info@example.de'; $subject='测试对象'; $data=”“。埃科(兰德(1244813451))。""; $headers=“From:”。去除标签($\u POST['req-email'])。“\r\n”; $headers.=“回复:”。去除标签($\u POST['req-email'])。“\r\n”; $headers.=“内容类型:text/html;”; $message=''; $message.=''$数据";;

这是我的代码:

$to='1!'info@example.de';
$subject='测试对象';
$data=”“。埃科(兰德(1244813451))。"";
$headers=“From:”。去除标签($\u POST['req-email'])。“\r\n”;
$headers.=“回复:”。去除标签($\u POST['req-email'])。“\r\n”;
$headers.=“内容类型:text/html;”;
$message='';
$message.=''$数据";;
$message.='';
if(邮件($to、$subject、$message、$headers)){
回显“您的邮件已成功发送”;
}否则{
echo“无法发送电子邮件。请重试。”;

}
您应该更改此行:

$data = rand(12448, 13451);

您应该更改此行:

$data = rand(12448, 13451);
$data=”“。埃科(兰德(1244813451))。"";不应该这样写。我很惊讶它没有给你带来任何错误。如果您只是将其更改为:

$data = rand(12448, 13451));
它应该可以正常工作。

$data=”“。埃科(兰德(1244813451))。"";不应该这样写。我很惊讶它没有给你带来任何错误。如果您只是将其更改为:

$data = rand(12448, 13451));

它应该可以正常工作。

Sidenote:Doing
echo$data=rand(1244813451))有效;旁注:Doing
echo$data=rand(1244813451))有效;他们只是做错了。谢谢!非常好,谢谢!工作得很好。