/    Sign up×
Community /Pin to ProfileBookmark

Sending mail from another html file

What I am trying to do is create a very simple email newsletter sending script. What I’m trying to do, is have the client write out their newsletter in FCK editor type program that creates a .html page of the newsletter. Then in a php script, I want to send that html as the actual email.

The testing script below prints out the includes html along with the successful message. However, the email that is received just has the number 1 sent.

Can someone help me with a way to send a newsletter that was written as a html page using php mail, please?

My testing scripts looks like this

[CODE]

<?php
$headers = “Content-type: text/htmlrn”;
$message = require($DOCUMENT_ROOT . “/TEST/test/test.html”);

if(mail(“[email protected]”, “Website Feedback”, $message, $headers))
{
$bodyMessage = “Your comments and concerns have been sent. A representative will be in contact with you shortly.<br><br> Thank you!”;
}
else
{
$bodyMessage = “Sorry, your comments have not been sent. Please send an email to [email protected]”;
}
?>

<html><head><body><?php echo $bodyMessage; ?></body></head></html>

[/CODE]

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@UltimaterOct 10.2008 — <i>
</i>$message = [color=blue]file_get_contents[/color]($DOCUMENT_ROOT . "/TEST/test/test.html");
×

Success!

Help @Patty5 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...