/    Sign up×
Community /Pin to ProfileBookmark

Email Html Formating

Friends ,
I am having A problem when I am sending email using Html Format.

The code is as follows..

$subject =”Contact from Website”;

$to = “[email protected]”;

$message = ‘

<html>
<head>

</head>
<body bgcolor = white>

<hr color=navy><center>
<b><table border=1>’;

// Here in message body put the fields that you want to show….

$message .='<br></td></tr><tr><td>Name</td><td>’ . $name;
$message .='<br></td></tr><tr><td>Email-ID</td><td>’. $email;
$message .='</td></tr></table></b>
<hr color=navy>
</body></html>’;
//echo $message;

$headers = “MIME-Version: 1.0rn”;
$headers .= “Content-type: text/html; charset=iso-8859-1rn”;

/* additional headers */
$headers .= “From: $emailn”;

$status = mail($to, $subject, $message, $headers);

When I get email it looks somthing like this…

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

From: [email][email protected][/email]

<html>
<head>

</head>
<body bgcolor = white>

<hr color=navy><center>
<b><table border=1><br></td></tr><tr><td>Name</td><td>jaydeep</td></tr><tr><td>Email</td><td>[email protected]</td></tr></table></b>
<hr color=navy>
</body></html>

So can Any one tell me what is the mistake i am making…

If i put email id of yahoo in the To field then Email comes formated.. and when i put gmail id and look that in outlook it shows unformated as it shows above..

PLease help me out…

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @Jaydeep spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.24,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...