Hiho,

Richard Kurth wrote:
> How can I add a variable to an e-mail on the fly. Say I have a form on
> my page that the user fells in with data. but when he fills in the
> message things like Hello,$Variable are added before it is sent. Does
> this make sence

Of course it does.
However, variables are not the way to go. The mails are not parsed, so 
variables won't do you any good. You'll have to use Placeholders. Something 
like this:

$mail_template = 
"Hi ##firstname## ##lastname##,
how are you...";

Now you can continue with str_replace():
$mail_content = str_replace('##firstname##',$fname,$mail_template);
$mail_content = str_replace('##lastname##',$lname,$mail_content);

regards
Wagner

-- 
"Isn't it strange? The same people who laugh at gypsy fortune tellers take 
economists seriously."
 - Cincinnati Enquirer   

Reply via email to