我有一个发送电子邮件的脚本,但是发件人名称不是“admin@foo.bar”,我希望它说“Foobar Admin”。我怎么能这样做?
谢谢!
答案 0 :(得分:0)
你想要这样的东西??
$email_from = $full_name.'<'.$email_from.'>';
答案 1 :(得分:0)
试试这个
<?php
$to = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
答案 2 :(得分:0)
使用此功能;
<?php
$to = 'to@mail.com';
$subject = 'Your subject';
$message = 'Your message';
$headers = 'From: Foobar Admin<admin@foo.bar>' . "\r\n" .
'Reply-To: admin@foo.bar' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
答案 3 :(得分:0)
mail("recipient@aol.com","subject","message","From:Foobar Admin<foobar@admin.com>");