Page 1 of 1

sending e-mails using php (more then just the mail function)

Posted: Sat Jun 01, 2002 4:03 pm
by Jimeee_1999
I was wondering, is there a way of sending e-mails using php and make it send in HTML so the e-mail shows up in HTML. For example, when I use the mail function the only thing I can do with the message is seperate the lines with \n. I can't even bold or underline text (atleast I think I can't). I made a form using HTML and would like to send not only the information from the form but also something close to the format of the form to an e-mail. In other words, the e-mail would not show up only as a pile of information, but instead would show up as a filled out form.

Thanks for your help!

Jim

Posted: Sat Jun 01, 2002 4:14 pm
by hob_goblin
i'm pretty sure you could just do like

$what_to_send = "<html><body><b>$name</b><br />\n"
."Some other stuff: $somevar\n";

and just send it like that

Try this

Posted: Sat Jun 01, 2002 7:23 pm
by icelord
I think that this would help.

----------------------------------------------------------------------------

$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
$headers .= "From: your_name<your_email>\n";
$mail = "<html><body>Enter your stuff here just like you would in a webpage, complete with all of the <b> tags,<br> tags and such</body></html>
$to = "some_email@someISP.com";
$subject = "Whatever";

//and then when you want to send mail just type in....

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

-----------------------------------------------------------------------------

There you go.... That should do it.....

Posted: Sat Jun 01, 2002 10:44 pm
by Anthron
like icelord said, you have to send a message in the header to tell the client that the email contains html.

Posted: Mon Jun 03, 2002 8:55 pm
by Jimeee_1999
ahhhh i see thanks a bunch!