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]
Hi All, I am a newbie here. I am hoping that someone from this forum can give me a hand with the PHP problem I'm having.
The code below works fine. It sends an email after a user has registered. However, I would like the email to be in HTML and I have no clue how to modify the code.
Thank you in advance for anyone who responds.Code: Select all
$to = $_REQUEST['email'] ;
$from = "a@somehwere.com" ;
$headers = "From: a@somehwere.com";
$subject = "Thank you for registering";
$fields = array();
$fields{"company"} = "Company Name";
$fields{"contact"} = "Contact Name";
$fields{"email"} = "Email";
$fields{"website"} = "Website URL";
$fields{"phone"} = "Phone No.";
$fields{"fax"} = "Fax No.";
$body =
"Dear Sir,
We have received the following information:\n\n";
foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); }
$send = mail($to,$subject, $body, $headers);feyd | 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]