0

第一封邮件只发给我,第二封给我和抄送。没有密件抄送。

电子邮件代码:

$to = 'to@email.com';
$subject = 'Email';
$message = '<html><body><p>Hello from me!<br>';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers = $headers . 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers = $headers . 'From: from@email.com' . "\r\n";
$headers = $headers . 'Reply-To: from@email.com' . "\r\n";
$headers = $headers . 'CC: cc@email.com' . "\r\n";
mail($to, $subject, $message, $headers);

如您所见,只有一个抄送和一个“收件人”地址。我不认为这是 PHP.ini 文件:

[PHP]

engine = On

max_execution_time = 60     ;
 Maximum execution time of each script, in seconds 
max_input_time = 120    ;
 Maximum amount of time each script may spend parsing request data
memory_limit = 128M      ; 
Maximum amount of memory a script may consume (8MB)

post_max_size = 150M

default_mimetype = "text/html"

default_charset = "UTF-8"

file_uploads = On

upload_max_filesize = 150M

allow_url_fopen = On

user_agent="PHP"

default_socket_timeout = 60

cgi.fix_pathinfo = 1

cgi.fix_pathinfo = 1

但它就在那里。为什么我要双打?

4

1 回答 1

0

我建议您使用 Swift Mailer 等电子邮件处理库。它处理这种事情比将你自己的标题串在一起要好得多。

http://swiftmailer.org/

于 2012-05-07T10:35:46.853 回答