Page 1 of 1

[Solved] Mail Syntax query

Posted: Tue Jun 28, 2005 6:24 pm
by Addos
Hi I wonder if anybody can help me with this tiny bit of script.

Basically I have a form where an email address is entered and once submitted I want to have a thank you type email sent to the person submitting the form.

I can’t seem to wok out how the string should be written up for example this works fine:

Code: Select all

$headers = 'To: admin(info@me.com), brian(brian@me.com)' ."\r\n";
But once I add this extra then the script fails

Code: Select all

$headers = 'To: admin<info@tuttiwebs.com>' .$_POST['email'] ."\r\n";
I’m hoping that it is a matter of syntax but I’m just stumped at the moment
:roll:
Thanks
Brian

Posted: Tue Jun 28, 2005 6:37 pm
by jadams
Should be as so:

Code: Select all

$headers = 'To: admin<info@tuttiwebs.com>, ' .$_POST&#1111;'email'] .&quote;\r\n&quote;;

Posted: Tue Jun 28, 2005 6:41 pm
by sulen
This is what I use maybe this is of help.

Code: Select all

/* recipients */ 
$to  = "$_POST[email]" . ", " ; 
/* subject */ 
$subject = "Whatever you need it to be";
/* message */ 
$mssg="Blah Blah Blah:\n
";
/* additional headers */ 
$headers .= "From: webmaster@yourdomain.com\r\n"; 
$headers .= "Reply-To: webmaster@yourdomain.com\r\n";

/* and now mail it */ 
mail($to, $subject, $mssg, $headers);
Hope this is helpful. Laters

Posted: Wed Jun 29, 2005 4:13 pm
by Addos
Thanks for this I help. I got this resolved ok.
Best Wishes
Brian :wink: