|
|
|
|
![]() ![]() |
Jul 26 2007, 08:34 PM
Post
#1
|
|
|
Newbie ![]() Group: Members Posts: 1 Joined: 26-July 07 Member No.: 47,021 |
I set up an form mailer which emails data to a company that a customer fills out, that works fine.
What I want is change the way the email looks so it's not so plain ex: change the size and color of fonts of the data, add background color, add company logo.... below is the code I wrote that emails customers data, from, to, subject info: CODE <?php //start building the mail string $msg .="A free estimate has been requested from www.mywebsite.com\n\n"; $msg2 .="Thank you for requesting a free estimate. A specialist will contact you within 24 hrs.\n\n"; $msg2 .="You are receiving this email because you signed up for a free pest estimate from www.mywebsite.com.\n"; $msg2 .="Please do not reply to this e-mail. This message came from an automated mailbox.\n\n"; $msg2 .="Ace Plumbing (555)555-555\n\n"; $msg .= "FIRST NAME: $_POST[name]\n"; $msg .= "LAST NAME: $_POST[last]\n"; $msg .= "ADDRESS: $_POST[address]\n"; $msg .= "ADDRESS 2: $_POST[address2]\n"; $msg .= "CITY: $_POST[city]\n"; $msg .= "ZIP CODE: $_POST[zip]\n"; $msg .= "HOME PHONE: $_POST[homefone]\n"; $msg .= "ALTERNATE PHONE: $_POST[altfone]\n"; $msg .= "E-MAIL: $_POST[email]\n"; $msg .= "PREFERRED CONTACT: $_POST[preferred_contact]\n"; $msg .= "PROBLEM: $_POST[stateDropDown]\n"; $msg .= "MESSAGE: $_POST[message]\n"; $msg .= "NOTIFIED ABOUT FUTURE OFFERS: $_POST[notify_future_offers]\n"; $msg .= "\n"; //set up the mail $recipient = "company@name.com"; $recipient2 = "$_POST[email]"; $subject = "Free Estimate Requested"; $mailheaders = "From: ace-plumbing.com<estimate@ace.com> \n"; $mailheaders .= "Reply-To: $_POST[email]\n\n"; //send the mail mail($recipient, $subject, $msg, $mailheaders); mail($recipient2, $subject, $msg2, $mailheaders); //end of PHP code ?> |
|
|
|
Jul 27 2007, 03:14 AM
Post
#2
|
|
|
A computer once beat me at chess, but it was no match for me at kick boxing. ![]() Group: [MODERATOR] Posts: 4,077 Joined: 24-July 05 From: Linix, DOS and Windows…the good, the bad and the ugly Member No.: 9,787 ![]() |
The php.net Manual has information about the use of the mail() to send html emails. By sending the Additional header to modify the mime type this is easily done.
Check out the last example on this link: http://ca.php.net/function.mail |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 7th October 2008 - 10:09 PM |