?
Solved

HTML Newsletter in Hotmail

Posted on 2004-08-28
5
Medium Priority
?
1,183 Views
Last Modified: 2006-11-17
Hi Friends,

How are you? I am sending HTML and TEXT emails to our subscribers. HTML emails comes perfectly in Yahoo, while gets distorted in Hotmail. Could you please guide me how could i solve this.

Thanks in advance.
0
Comment
Question by:dvpandya
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 27

Accepted Solution

by:
Diablo84 earned 252 total points
ID: 11923016
are you specifying the html content type in the headers

eg.

$headers  = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

mail("to@something.com","subject","message",$headers);

(ie. headers are the optional 4th parameter in the mail function)
0
 
LVL 27

Expert Comment

by:Diablo84
ID: 11923043
I have just tested with this script (sending to a hotmail address) and the html is displayed fine

<?php
$message = '
some html<br>
<table width="75%" border="1">
  <tr>
    <td>table</td>
    <td>data</td>
  </tr>
  <tr>
    <td><font color="#FF0000" face="Arial, Helvetica, sans-serif">table</font></td>
    <td>data</td>
  </tr>
</table>
';
$headers  = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

mail("ADDRESS_REMOVED","test2",$message,$headers);
?>
0
 
LVL 25

Assisted Solution

by:Marcus Bointon
Marcus Bointon earned 248 total points
ID: 11923356
Hotmail does some extremely unpleasant things to HTML email, typically removing/rendering useless the html, head and body tags so that it doesn't clash with the page it's embedded in. This really means that you have to use either inline CSS styles, or evil font tags if things are going to look right. Any CSS included in your head tag will be ignored, which could go a long way to explaining why things don't look right in many cases. This article may be of interest:

http://alistapart.com/articles/cssemail/
0

Featured Post

WordPress Tutorial 3: Plugins, Themes, and Widgets

The three most common changes you will make to your website involve the look (themes), the functionality (plugins), and modular elements (widgets).

In this article we will briefly define each again, and give you directions on how to install them.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
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…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

801 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