Email receiving in HTML format

Discussion in 'PHP' started by lew1s666, Dec 16, 2013.

  1. #1
    Hi,

    I moved our website from one webhosting to another and now I receiving emails in HTML format.

    this is my email_order_form.php


    <?

    $id = (int)$id;
    $row = @mysql_fetch_array(@mysql_query("select * from adv_order where ID = $id"));
    $userrow = @mysql_fetch_array(@mysql_query("select ID, strName, strTel, strMobTel, strLogo from adv_user where ID = ".$row["intUserID"]));

    $cont = "
    <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
    <html><head>

    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">
    <title>Advertising Services ::: Ireland, Dublin</title>
    <meta name=\"Keywords\" content=\"advertising, services, dublin, ireland\">
    <meta name=\"Description\" content=\"\">
    <meta name=\"AUTHOR\" content=\"\">
    <meta http-equiv=\"Content-Language\" content=\"en\">
    <meta name=\"RE-VISIT\" content=\"7 Days\">
    <style>
    .line {border-bottom: solid 1px; border-bottom-color: #000000; padding-top: 10px; padding-bottom: 10px}
    .lineText {border-bottom: solid 1px; border-bottom-color: #000000; padding-top: 0px; padding-bottom: 0px}
    .print {font: bold 14px arial, verdana; color: #000000}
    .common {font: 12px verdana, sans-serif, arial; color: #333333; text-align: justify}
    .title {font: 21px verdana, sans-serif, arial; color: #000000; text-align: justify}
    .client {font: 27px verdana, sans-serif, arial; color: #000000; text-align: center; }
    .fitter {background-repeat: no-repeat; font: 12px arial, verdana; text-align: center; width: 100px;}
    .slip {background-repeat: no-repeat; font: 12px arial, verdana; width: 200px; text-align: center}
    tr #tableHeader1 {background-color: #ffffff; font: 11px verdana, sans-serif, arial; color: #333333; padding-left: 3px; height: 20px}
    .ref {font: 18px verdana, sans-serif, arial; color: #000000}
    .comments {font: italic 12px verdana, arial;color: #666666; text-align: center; border-top: dotted 1px; border-top-color: #666666;}
    </style>
    </head>

    <body>
    <table cellpadding=\"0\" cellspacing=\"0\" width=\"700\">
    <tr valign=\"top\"><td width=\"100%\" nowrap>

    <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">
    <tr valign=\"top\"><td style=\"padding-top: 30px\">
    <!-- content starts here -->
    <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">
    <tr valign=\"top\">
    <td width=\"20\" rowspan=\"3\" nowrap><img src=\"http://advertisingservices.ie/images/dummy.gif\" width=\"20\"></td>
    <td style=\"border-bottom: solid 1px; border-bottom-color: #000000; height: 30px\" class=\"client\">";

    if (!empty($userrow["strLogo"])){
    $cont .= "<table width=100% cellpadding=0 cellspacing=5>";
    $cont .= "<tr>";
    $cont .= "<td width=100% class='client'>".$userrow["strName"]."</td>";
    $cont .= "<td width=1><img src='http://advertisingservices.ie/images/logo/".$userrow["ID"].".".$userrow["strLogo"]."'></td>";
    $cont .= "</tr>";
    $cont .= "</table>";
    } else {
    $cont .= $userrow["strName"];
    }

    $cont .= "</td>
    <td width=\"20\" rowspan=\"3\" nowrap><img src=\"http://advertisingservices.ie/images/dummy.gif\" width=\"20\"></td>
    </tr>
    <tr valign=\"top\">
    <td style=\"border-bottom: solid 1px; border-bottom-color: #000000; height: 30px\">
    <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">
    <tr>
    <td class=\"title\">
    ";

    switch ($row["intType"]) {
    case 1: $cont .= "Order"; break;
    case 2: $cont .= "Re-erect"; break;
    case 3: $cont .= "Remove"; break;
    case 4: $cont .= "Amend"; break;
    }

    $cont .= "
    </td>
    <td class=\"ref\" width=\"30%\">Ref.No ".$row["ID"]."</td></tr></table></td>
    </tr>
    <tr valign=\"top\">
    <td class=\"common\">
    <!-- content starts here -->

    <table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" width=\"100%\">
    <tr><td colspan=\"2\">
    <!-- fitters start -->
    <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">
    <tr><td height=\"30\" class=\"fitter\" background=\"http://advertisingservices.ie/images/fitter.gif\">Fitter 1</td><td class=\"fitter\" background=\"http://advertisingservices.ie/images/fitter.gif\">Fitter 2</td><td class=\"fitter\" background=\"http://advertisingservices.ie/images/fitter.gif\">Fitter 3</td><td class=\"fitter\" background=\"http://advertisingservices.ie/images/fitter.gif\">Fitter 4</td><td class=\"fitter\" background=\"http://advertisingservices.ie/images/fitter.gif\">Fitter 5</td><td class=\"fitter\" background=\"http://advertisingservices.ie/images/fitter.gif\">Fitter 6</td></tr>
    <tr><td colspan=\"6\"><img src=\"http://advertisingservices.ie/images/dummy.gif\" height=\"10\"></td></tr>
    <tr valign=\"middle\">
    <td class=\"slip\" background=\"http://advertisingservices.ie/images/slip.gif\" height=\"30\" colspan=\"2\">New Materials</td>
    <td class=\"slip\" background=\"http://advertisingservices.ie/images/slip.gif\" colspan=\"2\">From Stock</td>
    <td class=\"slip\" background=\"http://advertisingservices.ie/images/slip.gif\" colspan=\"2\">New Slip Made</td>
    </table>
    <!-- fitters end -->
    </td></tr>
    <tr id=\"tableHeader1\">
    <td>Sign Type</td>
    <td class=\"print\">".$row["strSignType"]."</td>
    </tr>
    <tr id=\"tableHeader1\">
    <td>Quantity of Boards</td>
    <td class=\"print\">".$row["intBoardsQuantity"]."</td>
    </tr>
    <tr id=\"tableHeader1\">
    <td>Order Date</td>
    <td class=\"print\">".date("d.m.Y", $row["intAddingDate"])."</td>
    </tr>
    <tr id=\"tableHeader1\">
    <td class=\"lineText\">Preferred Delivery Date</td>
    <td class=\"print\">From&nbsp;".date("d.m.Y", $row["intDeliveryDateFrom"])."
    &nbsp;&nbsp;To&nbsp;".date("d.m.Y", $row["intDeliveryDateTo"])."
    </td>
    </tr>
    <tr id=\"tableHeader1\">
    <td>Slip Titles</td>
    <td class=\"print\">".$row["strInstruction"]."</td>
    </tr>
    <tr id=\"tableHeader1\">
    <td class=\"lineText\">Copy</td>
    <td class=\"print\">".$row["strCopy"]."</td>
    </tr>
    <tr id=\"tableHeader1\">
    <td>Directions to Property</td>
    <td class=\"print\">".$row["strDirections"]."</td>
    </tr>
    <tr id=\"tableHeader1\">
    <td>Address</td>
    <td class=\"print\">".$row["strAddress"]."</td>
    </tr>
    <tr id=\"tableHeader1\">
    <td>Order Made by</td>
    <td class=\"print\">".$row["strMadeBy"]."</td>
    </tr>
    <tr id=\"tableHeader1\">
    <td>Contact Phone / Mobile</td>
    <td class=\"print\">
    ".((!empty($userrow["strTel"]))?$userrow["strTel"] : "").
    ((!empty($userrow["strMobTel"]))?$userrow["strMobTel"] : "").
    "
    </td>
    </tr>
    <tr id=\"tableHeader1\">
    <td>Extra Details</td>
    <td class=\"print\"><div style=\"width: 90%; border: solid 1px; height: 100px\">".$row["strDetails"]."</div></td>
    </tr>";
    if ($row["intType"] == 2) {
    $cont .= "
    <tr id=\"tableHeader1\">
    <td>Reerect Descripton</td>
    <td class=\"print\">".$row["strExtraDetails"]."</td>
    </tr>";

    }
    $cont .= "
    <tr id=\"tableHeader1\">
    <td>Date</td>
    <td class=\"print\"><img src=\"http://advertisingservices.ie/images/date.gif\"></td>
    </tr>
    <tr id=\"tableHeader1\">
    <td>Completed by</td>
    <td class=\"print\"><img src=\"http://advertisingservices.ie/images/slip.gif\"><br><br></td>
    </tr>
    </table>


    <!-- content ends here -->
    </td>
    </tr>
    </table>
    <!-- content ends here -->
    </td></tr>
    <tr valign=\"bottom\"><td class=\"comments\">Designed &amp; Powered by Quick Brown Fox Design Consultancy</td></tr>
    </table>

    </td></tr>
    </table>
    </body>
    </html>
    ";

    ?>
     
    lew1s666, Dec 16, 2013 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    My eyes... *shoots code dead*
    Honestly. That is some atrocious HTML-code. Besides, if you "all of a sudden" receive mail in HTML format after moving servers, why are you posting the code for the form? It doesn't send anything anywhere, it doesn't DO anything, apart from letting the user fill out a form. And an atrocious, malformed, piece of garbage form at that. Clean up your code, use [ code ] / [ /code ] brackets around your code, and not to mention, post some relevant code, then maybe we can help you.
     
    PoPSiCLe, Dec 16, 2013 IP
  3. DeanIM

    DeanIM Greenhorn

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    2
    Trophy Points:
    21
    #3
    If you're talking about your script sending mail as HTML code: the cause of that is the following line
     <meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">
    Code (markup):
    Try changing that to
     <meta http-equiv=\"Content-Type\" content=\"text/plain; charset=ISO-8859-1\">
    Code (markup):
     
    DeanIM, Dec 16, 2013 IP
  4. lew1s666

    lew1s666 Member

    Messages:
    101
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    30
    #4
    this code is 10 years old. We are going to make a new site but for the time we need solution.

    DeanIM going to try your solution and let you know. thanks
     
    lew1s666, Dec 16, 2013 IP