#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Posts
    31
    Rep Power
    16

    send email as html page


    hi guys,

    i need to be able to send an email back to a person once they have completed a form in the exact format of how they filled it in.
    ie, as a html page with all the text they entered in the text boxes and selected checkboxes, radio buttons, etc.

    the problem is the page is very big and has many fields so i was thinking, on my action page i just include a template to achieve this.

    ....and in the template can i do this type of thing:
    <input type="text" name="<php echo $txtAString ?> " size="12">

    //which is the name of the text box on the entry form on the previous page


    ...will that get the text out of the previous page and put it in with the included template?

    Any thoughts / suggestions would be greatly appreciated

    Regards,

    Aaron
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Posts
    31
    Rep Power
    16
    sorry made a mistake, text box code wrong, here is the correct one.

    <input type="text" name="txtWhatever" value="<php echo $txtAString ?> " size="12">
  4. #3
  5. Advice? call my little niece
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Location
    Utrecht, Netherlands
    Posts
    21
    Rep Power
    0
    Yep, it works...

    So ...
    $txtAString = 'textnamefield';

    and put it as a name in a textfield.
    After hitting the submitbutton, the var '$textnamefield' is available with the value of the textfield.

    good luck!
    Charlie
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Posts
    31
    Rep Power
    16
    ok still not working...and ideas what i'm doing wrong anyone?

    --------------------------------------------------------------------------------

    $recipient = "you@ADOMAIN.com.au"; // Recipients Email Address
    $subject = "THE SUBJECT"; // Email Subject


    //$message = "<img src=\"http://www.ADOMAIN.com.au/images/IMAGE.gif\">\n<p>";
    //$message .= "<img src=\"http://www.ADOMAIN.com.au/images/heading.gif\">\n<p>";
    $message = "";
    $message .= include("autoOrderQuoteTemplate.php");


    $headers = "From: autoresponse@ADOMAIN.com.au";
    $headers .= "Content-Type: text/html; charset=iso-8859-1\n";
    $headers .= "X-Priority: 1\n"; // The priority of the mail


    $formattedMSG = htmlentities($message);
    mail($recipient, $subject, $formattedMSG, $headers);


    note the above example with the text box and echo of php code is in "autoOrderQuoteTemplate.php"

    Regards,

    Aaron
  8. #5
  9. Advice? call my little niece
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Location
    Utrecht, Netherlands
    Posts
    21
    Rep Power
    0
    What's not working....?

    - You can't send a message through mail?
    - the value in the textbox isn't set?
    - sends mail but doesn't see anything in your emailclient??

    tell us !!
  10. #6

  11. Join Date
    Aug 2001
    Location
    NYC
    Posts
    57
    Rep Power
    17
    don't know if it was a type but
    <input type="text" name="txtWhatever" value="<php echo $txtAString ?> " size="12">
    should be
    <input type="text" name="txtWhatever" value="<?php echo $txtAString; ?> " size="12">
  12. #7

  13. Join Date
    Aug 2001
    Location
    NYC
    Posts
    57
    Rep Power
    17
    and on that note, why are you trying to send an actual form in an email? I'm sure that's your problem. Just echo the variable like you're doing, but remove it from the context of any form input box and just echo the value directly.
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Posts
    31
    Rep Power
    16
    hi guys,
    thanks for your replies, greatly apprectiated.

    ...now as far as sending the html page goes, i have to do it because i want the person to recieve the form they just filled in.

    doing it with just plain text and echoing it i've done b4 no probs there.

    the problem is the email client...it's recieving the mail but with none of the html code.

    i tried including the template in a page and outputting it to sceen and that worked perfectly.

    it's just when i when i try and attach it to the message string it doesn't seem to work, or maybe theres more to it that i'm not seeing here.

    any ideas?


    Regards,

    Aaron

IMN logo majestic logo threadwatch logo seochat tools logo