Use templates

instead of sending it to the webbrowser send it as an email...

http://www.phpbuilder.com for more info



-----Oorspronkelijk bericht-----
Van: Richard Kurth [mailto:[EMAIL PROTECTED]]
Verzonden: Tuesday, June 19, 2001 4:51 AM
Aan: [EMAIL PROTECTED]; Alexander Wagner
Onderwerp: Re[2]: [PHP] variables in a e-mail


Hello Alexander,
This is pretty much what I want to do. I want to have a e-mail script
in my application and have it so the user can customize the e-mail that
is sent out in a configure file. Say he wants to send a recurring bill
to his customers and he wants it to look a certain way. He would design
the e-mail using placeholders and the it would be processed and the data
would be filled in. Do you know of any examples of this in any program
that is out there. I do better when I can see complete examples to be
able to get the full picture

Monday, June 18, 2001, 4:01:45 PM, you wrote:

Alexander Wagner> Hiho,

Alexander Wagner> 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

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

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

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

Alexander Wagner> regards
Alexander Wagner> Wagner




-- 
Best regards,
 Richard  
mailto:[EMAIL PROTECTED]

Reply via email to