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 6552165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:25:37+00:00 2026-05-25T12:25:37+00:00

So I am in the process of gathering a user’s email address and submitting

  • 0

So I am in the process of gathering a user’s email address and submitting it to a database – but what I would really like to do is also submit an HTML email to them.

I have created the html of the email (with inline css, it is literally 1 page) and it looks like this:
enter image description here

So then I took this code and wrote the email submittingness in php:

ini_set("sendmail_from", "emailer@benjaminpotter.org");

    $to = $email;
    $subject = "Ben Potter Web Design - Newsletter Form Submission";   

    $emailthing = '    
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Form Submission - Newsletter Update</title>
</head>
<style type="text/css">
body {
    background-color:#e8faff;   
}

p {
    font-size:15px;
    font-family:Georgia, "Times New Roman", Times, serif;
    color:#141414;
    font-style:italic;
}

#mainbox{
    background-image:url(http://www.benjaminpotter.org/Images/emailtotheuser.jpg);
    width:345px;
    height:404px;   
    margin-left:auto;
    margin-right:auto;
    display:block;
    margin-top:50px;
}

#mainbox #textholder{
    width:279px;
    height:300px;
    display:block;
    position:absolute;
    margin-top:80px;
    margin-left:30px;   
}

#special{
    color:#72C0EF;
    text-align:center !important;
    font-style:normal;
}
</style>
<body>
<div id="mainbox">
<div id="textholder">
<p>
Thanks for signing up!<br />
I currently have you under the email:<br />
<span id="special">' . $email . '</span>
<br />
<br />
You will be receiving tri-monthly / <br />
quarterly emails from me, updating you<br />
on my latest works.<br />
<br />
Thank you for your intrest in <strong>Ben Potter
Web Design</strong>, you will receive the first newsletter soon.<br />
<br />
<br />
Yours Sincerely,
<br />
<strong>Ben Potter</strong>
</p>
</div>
</div>
</body>
</html>';  

$Rconfucious = "MIME-Version: 1.0\r\n";   
$Rconfucious .= "Content-type: text/html; charset=iso-8859-1\r\n";        
$Rconfucious .= 'From: Ben Potter Web Design 2011 <emailer@benjaminpotter.org>' . "\r\n";

@mail($to, $subject, $emailthing, $Rconfucious); 

But the problem is that it comes through like this:

enter image description here

So how do I get this to work properly?
Also, just a side note – the emails always go straight to junk mail and I don’t know how to change this… the user won’t see the email if it goes straight there.

Thanks for the help!

  • 1 1 Answer
  • 0 Views
  • 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-25T12:25:37+00:00Added an answer on May 25, 2026 at 12:25 pm

    Your email is correctly being sent as HTML. However, CSS/HTML support in email clients is akin to the situation we had in 1998.

    Gmail for example doesn’t support <style> tags which is why your email is rendering the way it is. I suggest you take a look at the following chart in order to see what each email client supports and to tailor your HTML template accordingly.

    So, essentially, your email has to be written as such:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Form Submission - Newsletter Update</title>
    </head>
    <body bgcolor="#72c0ef">
    <div style="background-image:url(http://www.benjaminpotter.org/Images/emailtotheuser.jpg); width:345px; height:404px; margin-left:auto; margin-right:auto; display:block; margin-top:50px;">
    <div style="width:279px; height:300px; display:block; position:absolute; margin-top:80px; margin-left:30px;">
    <p style="font-size:15px; font-family:Georgia, \'Times New Roman\', Times, serif; color:#141414; font-style:italic;">
    Thanks for signing up!<br />
    I currently have you under the email:<br />
    <span class="color:#72C0EF; text-align:center !important; font-style:normal;">' . $email . '</span>
    <br />
    <br />
    You will be receiving tri-monthly / <br />
    quarterly emails from me, updating you<br />
    on my latest works.<br />
    <br />
    Thank you for your intrest in <strong>Ben Potter
    Web Design</strong>, you will receive the first newsletter soon.<br />
    <br />
    <br />
    Yours Sincerely,
    <br />
    <strong>Ben Potter</strong>
    </p>
    </div>
    </div>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am in process of gathering information about web analytics tools (like Google Web
So I'm trying to automate a pretty tedious data gathering process from hundreds of
i was in the process of doing a fun project gathering music info/playable links
Process the data handed to an html page from a form. This is my
I have one process that's gathering data in real time and another process that's
Each process gets a 4 GB of virtual address space and out of 4
I would be interested to simulate an Age of Empires Rise of Rome gathering
I want to automate the process of gathering code metrics on a .NET solution.
A process running as a non-administrator user does not have rights to write to
I'm in the process of improving an open-source music database, which reads songs in

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.