Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/287.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
Javascript 可以在PHP的邮件函数中添加CSS吗?_Javascript_Php_Css_Function_Email - Fatal编程技术网

Javascript 可以在PHP的邮件函数中添加CSS吗?

Javascript 可以在PHP的邮件函数中添加CSS吗?,javascript,php,css,function,email,Javascript,Php,Css,Function,Email,我想在此代码中添加一些邮件函数中的css: $text .= "<h1>Confirmation Code</h1>"; $text .= "<img src='https://pbs.twimg.com/profile_images/587949417577066499/3uCD4xxY_400x400.jpg'></img>"; $text .= "<h3>This is your

我想在此代码中添加一些邮件函数中的css:

$text .= "<h1>Confirmation Code</h1>";
$text .= "<img src='https://pbs.twimg.com/profile_images/587949417577066499/3uCD4xxY_400x400.jpg'></img>";
$text .= "<h3>This is your confirmation code. Enter it into the text box in World Web. Here is the code: '".$_REQUEST['random_num']."'</h3>";
$text .= "<h4>Thank you for working with WWW. We appreciate the help!</h4>";
$text .= "</body></html>";
$subject = "Confirmation Code";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$to = $_REQUEST['email'];
mail($to, $subject, $text, $headers);

或:


它出错了。有人知道如何在php中将css添加到邮件函数中吗?

因为您没有在
中转义

尝试:

$text.=“确认码”;
//或
$text.=“确认码”;
style="color: red;"
style="background-color: blue;"