Forum Moderators: coopster
have i made that difficult/impossible using fread() since the welcom.php is really not being opened?
$newuser = 'John Doe';
include('welcome.php'); //import $message from welcome.php
mail($to, $message, etc...);
<?php
//welcome.php
if (!isset($newuser)) { //if the $newuser variable is not set, use a generic text (optional):
$newuser = 'new member';
}
$message = "Hello $newuser, thank you $newuser for joining our site!";
?>
//welcome.html file
<h3>Welcome {registrantName} to our website</h3>
....
Then in the .php file where email is sent:
//do the fopen and the fread (having $newuser and $message defined), then do a replace on $message:
$message = str_replace('{registrantName}', $newuser, $message);
//send email