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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending Email to More than one recipient

Status
Not open for further replies.

linda828

Technical User
Oct 25, 2002
13
US
I've set up a form that sends user input to my email account and it's working fine. I'd like to send that email to both me and my client, but nothing seems to work. I've tried entering two email addresses, separated by a semicolon in the "To:" line of the .txt file, I've tried a "Cc:", and I've tried setting up two "To:" lines. Anything else I can try?

 
Mail daemons can be real sticklers about their headers. Have you set up mime headers for the mail that gets sent? Here's some code that works for me, slightly altered for you. Hope it works!

Inger

-- begin code --

$you = "$your_email";
$client = "$your_client's_email";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: $your_form_email";
$headers .= "Cc: $client\r\n";
$headers .= "X-MSMail-Priority: Medium\r\n";
$headers .= "X-Mailer: PHP\n";
$headers .= "X-Priority: 2\n";
$subject = "Form Submission";
$message = "conglomeration of all of your form fields";
mail($you, $subject, $message, $headers) or die ("couldn't send mail!");
 
This is different than what I'm using. I take it that would be a .php file. What I've got now is a .txt that's working in some mysterious way off a cgiemail file in my cgi-bin, apparently something my server set up as part of my account. I would be happy to go ahead and understand this more thoroughly and learn the php involved. I've just cracked Zanstra's PHP4 book.

If I tried your .php file, is there a specific folder it should be in?

What does the r/n/ signify?
 
Hi,

By making that into a .php file you can put it anywhere you want. It's not a cgi script so it doesn't have to go into the cgi-bin but you can't put it in a folder called PHP. Although this may work for some others you will most likely get an error or page not found if you put it into a folder called PHP.

I don't personnally understand \r\n I know \n is new line but why the r is needed I don't know.

Hope this helps!
relax.gif

 
\r is for carraige return and is mostly needed only on windows machines.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top