/    Sign up×
Community /Pin to ProfileBookmark

Emails are coming with Html tags..

Hello,

I am using following code.But I am getting mails properaly.I am receiving emails along with html code .This was working ok before our hosting provide reset the server.What settings need to done with Apache / PHP config files..Pls guide.

[code=php]
<?php
// multiple recipients
$to = ‘[email protected]’ . ‘, ‘; // note the comma
$to .= ‘[email protected]’;

// subject
$subject = ‘Test Mail for HTML formatting’;

// message
$message = ‘
<html>
<head>
<title>Test Mail for HTML formatting</title>
</head>
<body>
<p>Here are the birthdays upcoming in August!</p>
<table>
<tr>
<td>Sally</td><td>17th</td><td>August</td><td>1973</td>
</tr>
<tr>
<td>Sally</td><td>17th</td><td>This is testing Email, Pls ignore</td><td>1973</td>
</tr>
</table>
</body>
</html>
‘;

// To send HTML mail, the Content-type header must be set
$headers = ‘MIME-Version: 1.0’ . “rn”;
$headers .= ‘Content-type: text/html; charset=iso-8859-1’ . “rn”;

// Additional headers
# $headers .= ‘To: Mangesh <[email protected]>, Mangesh <[email protected]>’ . “rn”;
$headers .= ‘From: Site admin <[email protected]>’ . “rn”;
# $headers .= ‘Cc: [email][email protected][/email]’ . “rn”;
# $headers .= ‘Bcc: [email][email protected][/email]’ . “rn”;

// Mail it
//mail($to, $subject, $message, $headers);
if (mail($to, $subject, $message, $headers))
{
echo “Mail Sent Successfully”;
}
else
{
echo “Mail Sending Failed”;
}

?>
[/code]

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@hastxApr 26.2007 — Your code works fine for me. It seems like a mime type issue, but that could be referenced from several files. What OS / Server are they running?
Copy linkTweet thisAlerts:
@joshi_mangeshauthorApr 27.2007 — Thx for your feedback..I dont have any permissions for the settings on Server.So What I need to tell our hosting provider to solve this issue....I Think he is reinstalled server and since then it is not working.
Copy linkTweet thisAlerts:
@hastxApr 27.2007 — I would just show him some screen shots of the problem. If he is providing you with a service, it's his problem to fix. besides, there are way too many variables for someone to ask him about to lead him in the right direction.

It could be something as simple as a messed up edit he may have made to a config file when trying to set security or options....or a bug in the particular update of the OS or web server he installed.
×

Success!

Help @joshi_mangesh 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.20,
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,
)...