Weird HTML email problem

Discussion in 'Site & Server Administration' started by crazyhorse, Feb 10, 2005.

  1. #1
    Before i was receiving emails from my host in normal html , now i receive them in this kind of format
    or

    Normally it would be looking really nice in html anyone know what im doing wrong. In my webmail im able to view them perfectly, but as soon it is send to an emailaccount it doesnt look nicely unless its send to my hotmail.
     
    crazyhorse, Feb 10, 2005 IP
  2. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You have references to external images. Most modern email clients will block such images because they are often used by spammers to figure out that you clicked on their links. You can consider using embedded images (search for cid:// to get more on this).

    J.D.
     
    J.D., Feb 10, 2005 IP
  3. crazyhorse

    crazyhorse Peon

    Messages:
    1,137
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #3
    But how come it works for hotmail.com, webmail and other service providers but not for Gmail and for microsoft outlook, and check this header its weird it comes from gmail,


    it says text/plain?
     
    crazyhorse, Feb 10, 2005 IP
  4. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Webmail clients display email messages as regular HTML pages and will show images unless your browser blocks them (e.g. in FF you can disable showing images unless they come from the same website - try it while viewing your test message). Regular mail clients, such as Outlook, display mail as mail and by default block external images.

    As far as text/plain goes, it's expected that mail can be converted to plain text. Moreover, some mail servers may be even configured to reject all HTML mail that doesn't contain a plain text message matching the HTML part (e.g. most compliant mail clients will send messages with content-type set to multipart/alternative and will contain both, plain and HTML versions of the message; try sending a message from Outlook and look at the headers).

    J.D.
     
    J.D., Feb 10, 2005 IP
  5. crazyhorse

    crazyhorse Peon

    Messages:
    1,137
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks still its weird that it worked before and now it isnt, since my move to another server. What would be an option to get it to work and how come do i receive in microsoft outlook and gmail , emails that do contain html and pictures?
     
    crazyhorse, Feb 10, 2005 IP
  6. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Look at the source of the email (Outlook Express is good with this - other mail clients often don't show the enitre message). If you see something like <img src="cid://...>, then this is how it works (cid refers to the content of this very message you are looking at).

    If images still refer to the external HTTP server, then it seems that your mail client isn't patched up or just not capable of protecting you in this sense.

    I can't say much about the new mail server - mail server admins can configure mail servers in a variety of ways.

    J.D.
     
    J.D., Feb 10, 2005 IP
  7. crazyhorse

    crazyhorse Peon

    Messages:
    1,137
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Well im not at my work anymore so im not able to check it at the moment. Hope the cid:// works for all if not i guess i need to contact the serveradmin again.
     
    crazyhorse, Feb 10, 2005 IP
  8. crazyhorse

    crazyhorse Peon

    Messages:
    1,137
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Is it something like this

    Mail.AddEmbeddedImage "c:\dir\bk.gif", "My-Image"
    Mail.Body = _
    "<HTML><BODY BACKGROUND=""cid:My-Image"">...</HTML>"
     
    crazyhorse, Feb 10, 2005 IP
  9. crazyhorse

    crazyhorse Peon

    Messages:
    1,137
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #9
    I have found this link doesnt make any sense to me thats for sure

    http://www.rfc-editor.org/rfc/rfc2111.txt

    One way is to include the images as file attachments associated with the HTML message (to give some more technical detail, this calls for the message to have content type multipart/related, with the first sub-part within it being multipart/alternative (containing the nested multipart combination of the plain text and HTML versions of the message) and subsequent parts being the appropriate MIME type for the images, like image/jpeg, etc. Each image has a Content-ID header giving a unique content ID string for referring to it (I describe these more in the page on MIME headers), so that the HTML can then refer to them in IMG tags using cid: URLs (as described in RFC 2111).
    http://mailformat.dan.info/headers/mime.html :eek: :eek: :eek:
     
    crazyhorse, Feb 10, 2005 IP
  10. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #10
    You found the right document. You can see how it works if you use your mail client to send an image not as an attachment, but as a part of the page layout. Not all mail clients will support this, but many will. Send it to yourself and once you get the mail, look at its source - you will see the cid:// part in img's src attribute. You will basically need to mimic this (or find a third-part tool that does this kind of thing; or figure out how to instruct your mail client to do it for you) if you want to create your own custom email messages with embedded images.

    With regards to parts, your message will contain several of them - one will be the message itself (may be in text and HTML, as two separate parts) and one per image. Each image part will have its own ID and each img in the message will refer to this ID.

    J.D.
     
    J.D., Feb 10, 2005 IP
  11. crazyhorse

    crazyhorse Peon

    Messages:
    1,137
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Is there any third kind of software that could do this you might know, and i have tried to open the email in outlook express but it doesnt(it does but not as HTML) open in there as well. I get the same kind of coding as described above , just plain text. Could it be possible that it might be my virus scanner that detects the email and doeesnt allow HTMl?
     
    crazyhorse, Feb 10, 2005 IP
  12. crazyhorse

    crazyhorse Peon

    Messages:
    1,137
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Could it be that the script creates an extra white header?
     
    crazyhorse, Feb 11, 2005 IP
  13. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Send yourself a test HTML message (make sure it's small - one sentence with HTML formatting; say, one paragraph with bold and italic text). Once you get it in Outlook Express, right-mouse click on the message and select Properties, the Details tab and click Message Source. Copy everything from there and either post here, or PM it to me.

    J.D.
     
    J.D., Feb 11, 2005 IP
  14. crazyhorse

    crazyhorse Peon

    Messages:
    1,137
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Could it be that the server from my host needs to update to the newest php version?Its running version PHP Version 4.3.10
     
    crazyhorse, Feb 11, 2005 IP
  15. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #15
    This I don't know. Sorry.

    You need to figure out what happens with the text of the email as it makes its way through the SMTP servers. It could be that one of them converts your mail to plain/text (I've seen this kind of thing before) or it could be that the headers are malformed, which causes the mail client to display the plain-text version of the email. It's hard to tell which case you are dealing with without looking at the message source.

    J.D.
     
    J.D., Feb 11, 2005 IP
  16. mjvworks

    mjvworks Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #16
    The problem spoken in this tread is the same I have. But NOT when you send mails from OL2003 to OL2003. The problem gets worse when mails are received by other emailclients than OL2003 (like OL2000, eudora etc.)
    Every time he sends the images as attachments. EVEN images which url's are linked from a website!
    The Meta Content has "text/html", but there is a secondary Meta Content which is "MSHTML 5.000... etc."

    The whole email-test is this:

    <x-html><!x-stuff-for-pete base="" src="" id="1" charset="iso-8859-1/macintosh"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML><HEAD>
    <META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
    <STYLE type=text/css>BODY {
    BACKGROUND-COLOR: #ffffff; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 11px; FONT-STYLE: normal; FONT-WEIGHT: normal
    }
    </STYLE>

    <META content="MSHTML 5.00.3700.6699" name=GENERATOR></HEAD>
    <BODY leftMargin=30 MARGINHEIGHT="15" MARGINWIDTH="30">
    <TABLE border=0 width=770>
    <TBODY>
    <TR>
    <TD background=http://www.client-site.nl/email/thing1.gif
    height=110><IMG height=110 src="http://www.client-site.nl/email/thing.gif"
    width=1></TD></TR>
    <TBODY>
    <TR>
    <TD>
    <P>&nbsp;</P></TD></TR></TBODY></TABLE><FONT size=3><SPAN
    class=574155011-01112005>fbsdhkbvhsbv hsdsdfdf</SPAN></FONT></BODY></HTML>

    </x-html>
    Content-Type: image/gif;
    name="thing.gif"
    Content-Description: thing.gif
    Content-Location: http://www.client-site.nl/email/thing.gif
     
    mjvworks, Nov 1, 2005 IP