send webpage from php send mail function

Posted on 2008-11-07
Last Modified: 2013-12-18
This is my code :

//Email start
if ($_POST["r_email"]<>'') {
$ToEmail = '';
$EmailSubject = 'Email Request via online form';
$mailheader = "From: ".$_POST["r_email"]."\r\n";
$mailheader .= "Reply-To: ".$_POST["r_email"]."\r\n";
$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n";
//Requester details
$MESSAGE_BODY .= "<font face=verdana size=2><u><strong>Requester details:</strong></u>"."<br>";
$MESSAGE_BODY .= "<strong>Name : </strong> ".$_POST["r_name"]."<br>";
$MESSAGE_BODY .= "<strong>Email : </strong> ".$_POST["r_email"]."<br>";
$MESSAGE_BODY .= "<strong>Contact No : </strong> ".$_POST["r_cont"]."<br>";
//Applicants details
$MESSAGE_BODY .= "<u><strong>Applicant details:</strong></u>"."<br>";
$MESSAGE_BODY .= "<strong>Name : </strong> ".$_POST["a_name"]."<br>";
$MESSAGE_BODY .= "<strong>1st email : </strong> ".$_POST["a_e1"]."<br>";
$MESSAGE_BODY .= "<strong>2nd email : </strong> ".$_POST["a_e2"]."<br>";
$MESSAGE_BODY .= "<strong>3rd email : </strong> ".$_POST["a_e3"]."<br>";
$MESSAGE_BODY .= "<strong>Contact No : </strong> ".$_POST["a_cn"]."<br>";
//Company details
$MESSAGE_BODY .= "<u><strong>Applicant details : </strong></u>"."<br>";
$MESSAGE_BODY .= "<strong>Name : </strong> ".$_POST["c_name"]."<br>";
$MESSAGE_BODY .= "<strong>Others company name : </strong> ".$_POST["c_names"]."<br>";
$MESSAGE_BODY .= "<strong>Department/unit : </strong> ".$_POST["c_dept"]."<br>";
$MESSAGE_BODY .= "<strong>Contact : </strong> ".$_POST["c_cont"]."<br>";

mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure");


With this code, i'm only able to send simple html to my email.
I would like to send it as webpage. A website in an email. I'm freely can using table, add more graphic on it. Spam email always do this. why not me.. hehe

the "$message_body" make me dificult to create what i want..

Question by:aihaiai
    LVL 7

    Expert Comment

    Hey there!

    Here is a nice tutorial how to send email in php, including html...

    LVL 16

    Accepted Solution

    Hello aihaiai,

    Could I ask why you are not using phpmailer for this type of developemt?



    Featured Post

    Why spend so long doing email signature updates?

    Do you spend loads of your time carrying out email signature updates? Not very interesting are they? Don’t let signature updates get you down. Let Exclaimer Cloud - Signatures for Office 365 make managing email signatures a breeze.

    Join & Write a Comment

    Granting full access permission allows users to access mailboxes present in their database. By giving full access permission one can open and read the content of any mailbox but cannot send emails from that mailbox.
    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    In this video we show how to create a mailbox database in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Servers >> Data…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now