English 中文(简体)
网址
原标题:php mail not working perfectly with outlook
  • 时间:2012-04-11 05:23:13
  •  标签:
  • php
  • outlook

我在使用购买力平价发送邮件方面遇到问题。 该邮件以《展望》方式收到,但它没有在电子邮件中显示“From”地址。

$subject = $_POST[ message_subject ];
$message = $_POST[ speaker_description ];
$email   = $_POST[ email ];
$option  = $_POST[ sel_reg_options ];
$email   = substr_replace($email ,"",-1);

$headers .= "Content-type: text/html; charset=iso-8859-1
";
$headers .= "From:My Name<[email protected]>
";
$headers .= "Reply-To: Registration of Interest<[email protected]>
";          
$headers .= "MIME-Version: 1.0"."
";
$mail_sent = @mail($email,$subject,$message,$headers);
问题回答

您应附上双重名称(这也适用于复读地址名称):

$headers .= "From: "My Name" <[email protected]>
";


Also, if running PHP on Unix, add the FROM envelope to the $additional_parameters parameter:

$mail_sent = @mail($email,$subject,$message,$headers, -f [email protected] );

php.ini 或使用:

ini_set( sendmail_from ,  [email protected] );


Sources: RFC2822, php.net user comment, IBM sendmail command reference





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签