php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12105 Mail Cc header problem
Submitted: 2001-07-12 10:35 UTC Modified: 2001-07-12 10:51 UTC
From: simon at vizija dot si Assigned:
Status: Not a bug Package: Mail related
PHP Version: 4.0.6 OS: Windows 2000 proffesional
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: simon at vizija dot si
New email:
PHP Version: OS:

 

 [2001-07-12 10:35 UTC] simon at vizija dot si
Hi,

In mail function on windows for windows paltform there is a nasty bug (I think).
I'm trying to execute folowing code, but it crashes every time :(((

<?php
mail( "haha@hehe.com", "Subject test", "Body test", "Cc: hihi@hehe.com\r\n" ) or die( "Cannot send mail" );
?>

If I instead Cc (wich is right on windows) write cc (small caps), then mail is sent, but without cc copy!! If I leave Cc (first letter Upper second Lower) then I get this error message:

Warning: Server Error in C:\razvoj\slowwwenia\massmail\test.php on line 2
Cannot send mail

I have tested this on the Windows 2000 proffesional and IIS 5.0 with PHP 4.0.4pl1 installed as ISAPI module. I have tested it with PHP 4.0.6 too and still didn't work :((
Is there any solution for this problem?

Thanks for any help
Simon

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-12 10:51 UTC] derick@php.net
This is not a bug. PHP's mail() function on Win2K uses a own implementation to talk to a mailserver. This code is not very smart at this moment, but a rewrite is on it's way (other bugs are posted for that).
Bogusifying this one.

Derick
 [2004-04-21 16:58 UTC] nick at solv dot it
You must place '\r\n' before each item in the header.
Also for Cc's and Bcc's use uppercase. ie. 'BCC'

For example:
$header = "From:info@php.net";
$header.= "\r\nCC:info@php.net";
$header.= "\r\nBCC:info@php.net";
 [2011-04-07 23:05 UTC] shashishankar573 at gmail dot com
<?php
// The message
$email = $_REQUEST['email'] ;
/*$message = $_REQUEST['message'] ;*/

$address = $_REQUEST['address'] ;
$city_state = $_REQUEST['city_state'] ;
$zip = $_REQUEST['zip'] ;
$phone = $_REQUEST['phone'] ;
$comments = $_REQUEST['comments'] ;
$name = $_REQUEST['name'] ;
$text = $name . ' - ' . $address . ' - ' .
$city_state . ' - ' . $zip . ' - ' . $phone . ' - ' . $email . ' -
' . ' - ' . $comments;
$to = 'shashishankar573@gmail.com';
$subject = 'the subject';
$message = '$text';
$headers = 'From: email' . "\r\n" .
    'Reply-To: $email' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers );

header(" Location: contact_thank.html " );
?>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC