Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP mail script: multiple recipients in CC and reply-to fields

Status
Not open for further replies.

LOOP123

Programmer
Mar 7, 2008
10
CA
Hello,

I have a working PHP mail script that captures input from a form (email, subject (topic), and the message (summary).

I now need help to modify my script so I can add multiple cc and reply-to recipients, one of which must be the person that completed the form (i.e. the From respondent must also be included in the cc and reply-to fields).

That is, I need to know how to make the following revisions:
[blue]
$to = me@me.com
$cc = $email (the From: person), 3rd_recipient@me.com
$reply-to = $email (the From: person), 3rd_recipient@me.com.[/blue]

Here is a snippet of my original code:

[red]$email = $_POST['email'];
$topic = $_POST['topic'];
$summary = $_POST['summary'];

$to = 'me@me.com';
$subject = "$topic_output";
$message = "$summary_output";

mail($to, $subject, $message, $headers);[/red]

Thanks so much - any help is greatly appreciated!
 
I'm not sure if my web hosting provider will allow phpmailer. I think I need to stick to php mail. I'm hoping there's an easy solution out there for me :)

Cheers,
Dipesh.
 
phpmailer is the easy solution. how would a hosting provider be able to prevent it? it's just a php script.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top