Page 1 of 1

Mail

Posted: Wed Feb 21, 2007 12:50 pm
by nashyboy
The Ninja Space Goat | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Guys this is probably very straight forward however, i can't quite work it out.

Please see the below code....

Code: Select all

<?php
$to = 'nashy@email.co.uk, ';
$subject = 'test';
$message = "Blah Blah\n\n
Name: " . $name . "\n 
Username: " . $username . "\n 
Site: " . $site . " \n
Role: " . $role . " \n\n
Regards\n
Selection Services";
$headers .= "cc: ghgfd@alh.co.uk\r\n";
$headers .= "From: Can@alh.co.uk\r\n";


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

?>
All works except the cc field.

I receive the email stating it has been cc'd to ghgfd@alh.co.uk however its doesnt actually go to them.....

Someone suggested that it may be the case cc was in but ive tried cc, CC and Cc, all which doesnt work.....

If someone could help it would be appreciated.

Thanks,

Paul


The Ninja Space Goat | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Wed Feb 21, 2007 12:58 pm
by Chris Corbyn
You never create $headers before trying to append to it.

Code: Select all

$to = 'nashy@email.co.uk, ';
$subject = 'test';
$message = "Blah Blah\n\n
Name: " . $name . "\n
Username: " . $username . "\n
Site: " . $site . " \n
Role: " . $role . " \n\n
Regards\n
Selection Services";
$headers = "";
$headers .= "Cc: ghgfd@alh.co.uk\r\n";
$headers .= "From: Can@alh.co.uk\r\n";

mail($to, $subject, $message, $headers);
However, I'd probably recommend downloading a proper mailer and reading this:

http://www.swiftmailer.org/wikidocs/v3/multirecipients