php-general | 2001062
Date: 06/18/01
- Next message: Steve: "[PHP] image retrival from db?"
- Previous message: Alexander Wagner: "Re: [PHP] Solution to "headers already sent" error."
- In reply to: Richard Kurth: "[PHP] variables in a e-mail"
- Next in thread: Richard Kurth: "Re[2]: [PHP] variables in a e-mail"
- Reply: Richard Kurth: "Re[2]: [PHP] variables in a e-mail"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Steve: "[PHP] image retrival from db?"
- Previous message: Alexander Wagner: "Re: [PHP] Solution to "headers already sent" error."
- In reply to: Richard Kurth: "[PHP] variables in a e-mail"
- Next in thread: Richard Kurth: "Re[2]: [PHP] variables in a e-mail"
- Reply: Richard Kurth: "Re[2]: [PHP] variables in a e-mail"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

