+ Reply to Thread
Results 1 to 5 of 5

Thread: Can I Include an Image in an HTML Email??

  1. #1
    Join Date
    Jun 2004
    Posts
    3

    Question Can I Include an Image in an HTML Email??

    Hello everyone,

    I have managed to create quite a complicated set of forms that output to an HTML email template and I am very happy with them. Thanks, by the way, for such a great bit of software and excellent documentation included. However, I would like to include an image in the email that is determined by a hidden field in the form. Is this possible?

    I have uploaded one of the forms for testing, here:
    www.tracksandpoles.com/pelmform01.shtml. There is an image at the top of each of these forms and it's this I would like to include in the email.

    Hope someone can help.

    Minskin

  2. #2
    Join Date
    Dec 2003
    Posts
    3,901

    Question Re: Can I Include an Image in an HTML Email??

    Hi,

    I think I understand....you want a different image dependant on the value of a field in the form?

    If the image is generated dynamically, then this is going to be difficult, but not impossible. It will involve more programming before you call FormMail.

    Howeve, if you want the form to select between a small number of images, then simply duplicate the HTML template and include a different image in each copy. The form can then select which HTML template to use.

    Does this answer your question?
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  3. #3
    Join Date
    Jun 2004
    Posts
    3

    Default Re: Can I Include an Image in an HTML Email??

    Hi Russell,

    thanks for your reply,

    yes, you understand me correctly and I have already thought of having a different email template for each image but I have 3 email templates to support 3 form styles with 14 possible image choices for each so that would mean 42 email templates! I don't think I want to go down that road.....

    If you could point me in the right direction as to how I could acheive what I want to do I would be grateful. I don't want to give up just yet if there's a way although I'm already thinking it may be beyond me.

    Much appreciated,

    Minskin

  4. #4
    Join Date
    Dec 2003
    Posts
    3,901

    Default Re: Can I Include an Image in an HTML Email??

    Hi,

    How are your PHP skills?

    Once you have the information required to select the image (e.g. from the user's responses on the form), here's how you proceed:
    1. A PHP script takes a standard template and changes the "img" tag to point to the right image; it copies that template to the template directory under a new name (a temporary file).
    2. It calls FormMail and specifies that new temporary file as the template to use for the HTML email.
    3. It removes temporary files older than some hours (auto cleanup).
    So, it would look a little like this:
    Form
    |
    PHP Preprocess script -> creates temporary template
    |
    FormMail
    All quite easy to do, but you need to be a bit of a programmer.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  5. #5
    Join Date
    Jun 2004
    Posts
    3

    Default Re: Can I Include an Image in an HTML Email??

    Hi Russell,

    Mmmmmmm, well, my php skills are just about none existent. I have had a look at a couple of php tutorials and I have a lot to learn! I will try and work on it though because as well as being handy for the images in the emails, I have a large website and acquiring php skills will probably prove to be very useful. I can manage without the images in the emails for now until I learn how to include them. Thanks so much for the suggestion.

    Minskin

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Sending form results in an HTML email
    By russellr in forum HOWTO Guides and Tips
    Replies: 26
    Last Post: 12-Jan-2006, 09:31 PM
  2. HTML Email does not work if not all fields are filled.
    By onlmega in forum FormMail Subscription Support
    Replies: 7
    Last Post: 04-Aug-2004, 12:02 AM
  3. HTML Email not working
    By Rich in forum FormMail Subscription Support
    Replies: 9
    Last Post: 23-Jul-2004, 10:11 PM
  4. HTML email reply
    By aussieincanada in forum FormMail Subscription Support
    Replies: 5
    Last Post: 04-Jun-2004, 07:07 AM
  5. send an email in HTML
    By michecosta in forum FormMail Subscription Support
    Replies: 3
    Last Post: 25-May-2004, 09:18 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts