SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2006
    Location
    Toronto
    Posts
    89
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    HTML format emails

    I have an application which sends out emails in HTML format. I have a problem when I am trying to display images in the email (name of the image file is taken from database).

    The problem is that if there is a space in the image file name, it displays a + (PLUS sign) and does not display the photo in GMAIL and other emails. The URL of the image gets displayed in the following manner:

    3_Marathon+Crescent_Toronto_1.jpg+

    How do I solve this + (PLUS sign) issue????

  2. #2
    SitePoint Guru SSJ's Avatar
    Join Date
    Jan 2007
    Posts
    830
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It will always encode the spaces so you will have to replace spaces with _(underscore) in image names.

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2006
    Location
    Toronto
    Posts
    89
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But how would I do this? I have a form composed of 3 fields: street #, name and city. Depending on the user input, the image file name is composed of these 3 input (i.e. streetNumberstreetNamecity.jpg). So if a street name is composed from 2 words the image file name would resemble the following: streetNumberstreetName+streetNamecity.

    At which point would I apply a Javascript replace() method or something else???? Before it's saved to database or after?

  4. #4
    SitePoint Guru SSJ's Avatar
    Join Date
    Jan 2007
    Posts
    830
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can use VBScript's Replace function as follow:

    response.write Replace(image," ","_")

    -SSJ


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
  •