views:

386

answers:

3

my mail have some tempalte with HTML tags includes and images.. when i am sending mail to my id and open that in Gmail it getting the correct template but in thunderbird am getting only html tags... not the correct format

code:

<?php
// multiple recipients
$to  = '[email protected]'; // note the comma


// subject
$subject = 'Birthday Reminders for August';

// message
$message = '  

<h1> hiii </h1>  <h3>h3</h3> <strong> strong </strong>
  <p>Here are the birthdays upcoming in August!</p>
  <table>
    <tr>
      <th>Person</th><th>Day</th><th>Month</th><th>Year</th>
    </tr>
    <tr>
      <td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
    </tr>
    <tr>
      <td>Sally</td><td>17th</td><td>August</td><td>1973</td>
    </tr>

';

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version:1.0'. "\r\n";
$headers .= 'Content-type:text/html;charset=iso-8859-1' . "\r\n";

// Additional headers
$headers .= 'From:Birthday Reminder <[email protected]>' . "\r\n";

// Mail it
mail($to, $subject, $message, $headers);
?>

what i need to change for thunderbird?

   Content-type: text/html; charset=iso-8859-1

Return-Path: <[email protected]>




<html>
<head>
<title>Registration</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<p><strong>Dear xdcxz   fdzfsd <br />

<a href="www.site.com/id/2">Click here</a> to accept...

</p>
</body>
</html>

This is the way it is shown in Thunderbird.

but in gmail i got the correct html rendreing...

A: 

http://www.anandgraves.com/html-email-guide#javascript

and resources and tips on campaignmonitor.com are both very good for guidelines on creating successfull html emails.

99% of the time i have trouble with formatting is down to css, or the lack of support thereof in various clients, support can vary wildly from client to client.

Best advice read these and you will see what to do/avoid for the best results!

Brian
Hi i updated the question please see once...
coderex
+1  A: 
    Content-type: text/html; charset=iso-8859-1

That line appears in Thunderbird, with the spaces at the start and everything? Then you're not sending the header right... Either you're trying to put the headers in the body, or one of your headers preceding Content-Type has a spurious newline in the value, ending the header lines early and making your Content-Type line not get counted as a header. Let's see your sending code.

But... for a registration confirmation mail there is no point using HTML. You'll get better compatibility and an easier sending process by just putting the URL you want in a text e-mail. All modern e-mail clients will pick out the URL to make it clickable anyway.

ETA: it is difficult to tell as the sending code you have posted does not match the example message. It might also help to see the full message source with headers (which can be viewed in Thunderbird, or saved as .eml).

However, there is likely something going wrong with the newlines. According to the note onthe mail manpage, you may need to use "\n" instead of "\r\n" if the mailer on your server is crap and broken?

bobince
could you please check my new question updates
coderex
A: 

HI all, finally i got the answer ... :)

I replaced all the "\r\n" as "\n" ... Now it is working fine :-) So please keep in mind :)

Thank you very much

coderex