SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Feb 2009
    Location
    Southern California
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Extra Spaces Added by Mail Server/Client in HTML Email

    Hello, I'm having an issue with certain mail servers (lotus, aol, etc) that add extra spaces to the html code of my html email. This is causing an issue with images and links. For example, in the code, I will point to an image like:


    ...ttp://domain.com/img/image.gif...

    And the receiving mail server will sometimes add an extra space(s) like:


    ...ttp:// domain.com/img/image.gif...

    This of course breaks the code and causes the images to not display and/or links to 404.

    Has anyone else seen this and have a resolution?

    Note, this doesn't always happen on every server. If I send the exact same email to my exchange server, it displays fine. Also, I'm not sure if it's the receiving mail server or mail client that is adding the extra space(s).

    Any help is appreciated.

    Thanks!
    Code HTML4Strict:
     

  2. #2
    SitePoint Wizard Darren884's Avatar
    Join Date
    Aug 2003
    Location
    Southern California, United States
    Posts
    1,616
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The mail is probably adding the extra space so it doesn't display the images because it doesn't trust the mail.
    Have a good day.

  3. #3
    SitePoint Member
    Join Date
    Feb 2009
    Location
    Southern California
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't think that is the case, the email basically has a list of images in it and it will just add a space to the path in the src for one out of about 30 or more. It doesn't always apply to just img tags either, sometimes it adds it to table tags or just randomly. The mail server doesn't place the email in the spam folder either, it goes directly to the inbox.

    I have tried base64 encoding the email and updating the email headers to specify that it is a base64 encoded email and that works, however, I then have the issue that some users don't have mail clients that can base64 decode the email, so I couldn't go that route....

  4. #4
    SitePoint Member
    Join Date
    Feb 2009
    Location
    Southern California
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So it turns out if the URL/Path to the image or link is really long, the mail client sometimes puts a space (%20) into the path which causes the loading of the image to fail.

    Shortening the path to the image fixed the issue.


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
  •