有谁知道如何在使用 php mail() 回显变量和字符串本身之间为主题行放置一个空格?我试过这个
$subject = $user_data->first .' '.'recommends a place';
还有这个
$subject = $user_data->first .' recommends a place';
但是当邮件发送时,它会显示'Kevinrecommends a place'。
这是完整的邮件代码:
$to = $form_input['email'];
$subject = $user_data->first .' recommends a place on';
$msg =
'Hi,'."\r\n".
"\r\n".
'You were recommended a place by '.$user_data->first .'.'."\r\n".
"\r\n".
'Click the link to see it on **!'."\r\n".
'www.**.com/'.$token."\r\n".
"\r\n".
'Cheers,'
$from = 'From:noreply@**.com';
mail($to, $subject, $msg, $from);