Avatar of Bruce Gust
Bruce Gust
Flag for United States of America asked on

Why does my email look this why in google?

Attached is a screen shot of the email that I'm sending out. As you can see, everything is displaced, yet when I run the code on my browser, it looks fine. The code is below:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Texaco Country Music Showdown</title>
<link rel="stylesheet" type="text/css"href="http://www.countryshowdown.com/email/style.css">
<MAP NAME="header_map">
<AREA
   HREF="http://www.countryshowdown.com/Texaco/index.php" ALT="Home" TITLE="Home"
   SHAPE=RECT COORDS="25,131,71,147">
   <AREA
   HREF="http://www.countryshowdown.com/Texaco/TVStations.php" ALT="TV Stations" TITLE="TV Stations"
   SHAPE=RECT COORDS="115,132,175,144">
    <AREA
   HREF="http://www.countryshowdown.com/Texaco/ContestLocations.php" ALT="Radio Stations" TITLE="Radio Stations"
   SHAPE=RECT COORDS="224,135,300,145">
    <AREA
   HREF="http://www.countryshowdown.com/Texaco/ContestantList.php" ALT="View Contestants" TITLE="View Contestants"
   SHAPE=RECT COORDS="367,131,462,147">
        <AREA
   HREF="http://www.countryshowdown.com/Texaco/Contact.php" target="_blank" ALT="Contact" TITLE="Contact"
   SHAPE=RECT COORDS="520,134,566,144">
      </map>
</head>

<body background="http://www.countryshowdown.com/images/BSPpreStephan_01.gif"  LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>

<table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
<tr>
<td valign="top" align="center" valign="top">&nbsp;<BR>
&nbsp;<BR>&nbsp;<BR>
      <table height 0% width="600" align="center" cellpadding="0" cellspacing="0" border="0">
      <tr>
      <td background="http://www.countryshowdown.com/images/PencilLine.jpg" width="2">&nbsp;<BR>
      </td>
      <td bgcolor="white" valign="top">
      <IMG SRC="http://www.countryshowdown.com/images/email_header.jpg" width="600" border="0" USEMAP="#header_map">
      </td>
      <td background="http://www.countryshowdown.com/images/PencilLine.jpg" width="2">&nbsp;<BR>
      </td>
      </tr>
      <tr>
      <td background="http://www.countryshowdown.com/images/PencilLine.jpg" width="2">&nbsp;<BR>
      </td>

      <!- main content ->
      <td valign="top" bgcolor="white" align="center">
            <table cellspacing="0" cellpadding="0" valign="top" border="0">
            <td valign="top" align="center">
                  <table border="0" width="590" cellspacing="0" cellpadding="0" align="center">
                  <tr>
                  <td background="http://www.countryshowdown.com/images/spacer.gif" height="300" width="590" valign="top">
                  
                  <!- content ->
                  
                  &nbsp;<BR>&nbsp;<BR>Hello, $the_first_name !<P>To validate your email and to ensure that your votes count, click on the link below.";
$message .= "<P><A HREF=\"http://www.countryshowdown.com/Texaco/songwriting_voter_validation.php?email=$voter_email&chk=$the_digest\" target=\"_blank\">http://www.countryshowdown.com/Texaco/songwriting_voter_validation.php?email=$voter_email&chk=$the_digest</a><P>If you have any questions, you can contact your Showdown staff by clicking <A HREF=\"http://www.countryshowdown.com/Texaco/Contact.php\" target=\"_blank\">

                  </td>
                  </tr>
                  </table>
        </td>
            </tr>
            </table>

            <!- your copy ends here - >

      

            <!- end main content ->
      </td>
      <td background="http://www.countryshowdown.com/images/PencilLine.jpg" width="2">&nbsp;<BR>
      </td>
      </tr>
      <tr>
      <td background="http://www.countryshowdown.com/images/PencilLine.jpg" width="2">&nbsp;<BR>
      </td>
      <td height="70" background="http://www.countryshowdown.com/email/new_footer.jpg">
      &nbsp;<BR>
      </td>
      <td background="http://www.countryshowdown.com/images/PencilLine.jpg" width="2">&nbsp;<BR>
      </td>
      </tr>
      </table>
</td>
</tr>
<tr><td colspan="3" align="center">&nbsp;<BR>Special Promotions, Inc | 63 Music Square East | Nashville, TN 37203 | (p) 615.321.5130 | (w) <A HREF="http://www.countryshowdown.com" target="_blank">countryshowdown.com</a>&nbsp;<BR>&nbsp;<BR></td></tr>

</table>
</body>
</html>


What am I missing? Thoughts?


 screen shot of messed up email in google
PHP

Avatar of undefined
Last Comment
Ray Paseur

8/22/2022 - Mon
Sandeep Kothari

are you using text/html as content type when sending email ?
Bruce Gust

ASKER
Yes - here are my headers:

$headers = 'MIME-Version: 1.0'. PHP_EOL;
$headers .= 'Content-type: text/html; charset=iso-8859-1'. PHP_EOL;
$headers .= 'FROM: contest@countryshowdown.com'. PHP_EOL;

The whole PHP code looks like this:

$subject_line = "voter validation";
$from_email = "contest@countryshowdown.com";
$the_first_name = stripslashes($_POST['voter_first_name']);

$headers = 'MIME-Version: 1.0'. PHP_EOL;
$headers .= 'Content-type: text/html; charset=iso-8859-1'. PHP_EOL;
$headers .= 'FROM: contest@countryshowdown.com'. PHP_EOL;
$to = $voter_email;
$subject = $subject_line;
$message .= file_get_contents('email_header.php');
$message .= "&nbsp;<BR>&nbsp;<BR>Hello, $the_first_name !<P>To validate your email and to ensure that your votes count, click on the link below.";
$message .= "<P><A HREF=\"http://www.countryshowdown.com/Texaco/songwriting_voter_validation.php?email=$voter_email&chk=$the_digest\" target=\"_blank\">http://www.countryshowdown.com/Texaco/songwriting_voter_validation.php?email=$voter_email&chk=$the_digest</a><P>If you have any questions, you can contact your Showdown staff by clicking <A HREF=\"http://www.countryshowdown.com/Texaco/Contact.php\" target=\"_blank\">here</a>.<P>Thanks!";
$message .= file_get_contents('email_footer.php');
mail($to, $subject , $message, $headers);
SOLUTION
Sandeep Kothari

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER CERTIFIED SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Ray Paseur

Afterthought: I have had good success with http://www.constantcontact.com/index.jsp
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy