Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

emailing html file? is that possible? 1

Status
Not open for further replies.

diezy

Technical User
Sep 2, 2002
50
0
0
CA
i am trying to send an email after a user has registered an account online, and i was wondering instead of retyping where i have to keep on contactinating a string of html code...
<?
$message ="<html>"
$message =."<title>google homepage</title>"
$message =."<head>blah blah blah</head>"
$message =."....etc

?>
if there is a way where i could just email the file or copy and paste the code without editng it to be sent in the message variable??


any suggestion would be great.


"my lips hurt real bad!!!"
 
The message must be read into memory. That's the only way to pass the message body to the mail() function.

If you don't like all the multiple concatentation lines, use one line. This will work:

$message = '<html><title>google homepsge</title></head>....';

This will work, too:

$message = '<hml>
<title>google homepage</title>
<head>blah blah blah</head>
....etc';

If the message is static and you don't want to look at the message body in your script at all, you could put the message text into a file and use file_get_contents() to read the file into a variable.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
What you can do is create a file... say email_content.html... and then open the file in your script...

$body = file_get_contents("email_content.html");
 
file_get_contents()
Awesome.....Thanks...thats exactly what i was looking for.


"I spent like three hours shading the upper lip.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top