donglang6656 2016-04-06 08:41
浏览 81
已采纳

在phpmailer头文件中的两个变量之间添加空格

I'm sending a form mail with php.

I need to set the "from:" to the form fields which live in the variables: $user_name and $user_lastname.

So i tried:

$headers .= 'From: ' . $user_name . " " . $user_lastname . "
";
$headers .= 'X-Mailer: PHP/' . phpversion();

But then i get "unknown sender" instead of name and last name.

  • 写回答

2条回答 默认 最新

  • doushishi6513 2016-04-06 08:44
    关注

    try this:

    $headers .= 'From: "'.$user_name." ".$user_lastname.'"<'.$user_email.'>'."
    ";
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?