3

I've written a mail that'll send emails with images as attachments. The images are displaying in yahoo and gmail. But hotmail is displaying a square grey box wherever there should be an image. The following is the code that builds the image. Of course I'm reffering to it in the mail using cid. Thanks a lot in advance.

l_embedImage = new MimeBodyPart();
l_dataSource = new FileDataSource(new File(l_imagesBaseDirectory + "/" + l_completeImagePath));
l_dataHandler = new DataHandler(l_dataSource);
l_embedImage.setDataHandler(l_dataHandler);
l_embedImage.setHeader("Content-ID", "<" + l_cid + ">");
l_embedImage.setHeader("Content-Type", "image/gif");
l_embedImage.setHeader("discrete-type","image");
l_embedImage.setHeader("content-transfer-encoding", "base64");
p_multipart.addBodyPart(l_embedImage);
Stardust
  • 1,115
  • 6
  • 22
  • 33
  • 1
    Have you tried using Firefox's plugin Firebug and inspect the HTML code that displays that grey box? Maybe it can tell you more why Hotmail doesn't show the image in right way – Boris Pavlović Jan 25 '10 at 19:15

2 Answers2

2

I was having troubles with delivering e-mails until I went through the steps to become a trusted mail server.

Check out step 4 ("Authenticate your outbound e-mail: Publish Sender Policy Framework (SPF) records") in the following URL: http://postmaster.msn.com/Guidelines.aspx

Andrew Dyster
  • 2,278
  • 19
  • 23
0

I think that hotmail doesn't load them automatically, the user should agree on this message first:

Attachments, pictures, and links in this message have been blocked for your safety. Show content

As usual Microsoft must complete programmers life ;)

Omar Al Kababji
  • 1,768
  • 4
  • 16
  • 31
  • 1
    Same for Gmail: "Gmail disables images to protect you from unknown senders, like spammers, who use images and links to verify that your email address is real." http://mail.google.com/support/bin/answer.py?hl=en&answer=8833 – rochb Jan 26 '10 at 19:48