468,242 Members | 1,721 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,242 developers. It's quick & easy.

If Statements in PHP Mail's HTML Messages?

chunk1978
224 100+
is it possible to dynamically change the HTML message inside PHP's mail() function sent from a form? i had something previously written in javascript but i guess it's not a smart idea to include javascript in a .php mail script...

so within the "$message" part of the mail script, would i write something like this:

Expand|Select|Wrap|Line Numbers
  1. $message = '
  2. echo "<html>\n"; 
  3. echo "<body>\n"; 
  4. if ($_POST['AdditionalComments'] !="")
  5. {
  6. echo "This was your comment that you wrote on our website:"\n;
  7. echo "'$AdditionalComments'"\n;
  8. echo "</body>\n"; 
  9. echo "</html>\n";
  10. ';
  11.  
would totally appreciate help with this...
Apr 9 '07 #1
0 900

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by Bruce W...1 | last post: by
15 posts views Thread by Cem Louis | last post: by
2 posts views Thread by Jaunty Edward | last post: by
1 post views Thread by prasanna | last post: by
9 posts views Thread by AJ | last post: by
2 posts views Thread by knoak | last post: by
12 posts views Thread by Jerim79 | last post: by
4 posts views Thread by Alec MacLean | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.