mail script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
attackle98
Forum Newbie
Posts: 11
Joined: Wed Oct 27, 2004 10:13 am

mail script

Post by attackle98 »

Code: Select all

<?php
<?php
$to = $_POST['to'];
$subject = "You Have Been Invited To Join halfmoonstreetmusic.com";
$body = "welcome.txt";
$headers = "From: welcome@halfmoonstreetmusic.com\n";

echo "Mail sent to $to";
mail($to,$subject,$body,$headers);

?>
?>
i want the $body variable to use the welcome.txt file but im not sure if it can be done
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: mail script

Post by Weirdan »

attackle98 wrote: i want the $body variable to use the welcome.txt file but im not sure if it can be done

Code: Select all

$body = file_get_contents('welcome.txt');
attackle98
Forum Newbie
Posts: 11
Joined: Wed Oct 27, 2004 10:13 am

Post by attackle98 »

thank you
Post Reply