Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 700013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:27:00+00:00 2026-05-14T03:27:00+00:00

here is some code I’ve been working on, basically I need to set up

  • 0

here is some code I’ve been working on, basically I need to set up a auto e-mail that gets sent to a user after they fill in a form, which at the moment it is doing, but the HTML is not displaying as it should inside of the email client.

I checked in Gmail, Outlook and Mac mail and none of them display the HTML correctly.

Here is the code

<?php
    session_start();
    $_SESSION['name'] = $_POST['name'];
    $name = $_SESSION['name'];
    $email_1 = $_POST['email_1'];
    $email_2 = $_POST['email_2'];
    $email_3 = $_POST['email_3'];
    $email_4 = $_POST['email_4'];
    $id_num = $_POST['id_num'];
    $tel = $_POST['tel'];
    $email = $_POST['email'];



    //sets the current date

    $curDate = date("Y-m-d");

    // Example


    require_once("mailclass/htmlMimeMail.php");
    $mail = new htmlMimeMail();
    $mail->setSubject("Your submission to MyWebsite!");
    $mail->setFrom("MyWebsite <info@website.co.za>");
    $mail->setFrom("MyWebsite <info@website.co.za>");
    $email_address = $email_1 . "," . $email_2 . "," . $email_3 ."," . $email_4 ;
    $mail->setBcc($email_address);





    $day = "
         <body style="'background: #000000; color: #FFFFFF;'">
         <div style="'background-image: url(http://www.website.com/images/mailerbg.jpg); width: 900px; height: 839px; margin: 0 auto;'">
         <div style="'width: 620px; height: 280px; position: relative; top: 155px; left: 25px;'">
                <h1><br>your friend $name<br><br><br></h1>
            </div>    
        </div>
        </body>";

    $mail->setHTML($day);   
            $result = $mail->send(array());

    ?> 

The code is pretty messy, from me screwing around with it so much, but basically none of the HTML shows up as it should in the email client once the message arrives at it’s destination, how can I get it to display as a proper HTML page inside of the mail client?

I am assuming that my escaping is not done correctly, which is why nothing is showing as it should?

Thanx in advance!

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T03:27:00+00:00Added an answer on May 14, 2026 at 3:27 am

    Showing the PHP code is useless in this case. We need to see a final, generated E-Mail.

    What catches the eye, though, is some faulty quoting:

     <body style="'background: #000000; color: #FFFFFF;'">
    

    should be

     <body style="background: #000000; color: #FFFFFF;">
    

    Maybe that fixes it already.

    In addition, according to this great guide, positioning is hardly supported in E-Mails – this could disturb the layout as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's some code: DirectorySearcher searcher = new DirectorySearcher(); searcher.Filter = (&(objectClass=user)(sAMAccountName= + lstUsers.SelectedItem.Text +
Here is some code that I have that works perfectly: Sub EncryptFile(ByVal sInputFilename As
Here is some code that I'm trying to make save some UITextView text. When
Here is some code that takes an int error code (scode) and tries to
Here's some code from an FTP application I'm working on. The first method comes
Here is some code outlining a problem I've been wrestling with. The final problem
Here is some code that used to work with my code, but is having
Here's some code that has two arrays(np and op), one a copy of the
here is some code that I plan on using in a registration form for
Here's some code that throws an exception because of some of the memory management

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.