tags:

views:

227

answers:

1

Hi All : I am working mail sending part in my project. My requirement is to generate an image and append it with mail content(using tag). Once the mail has been sent, image should be deleted in application server. After mail sent, two scenarios are happening

Scenario 1 :
When i open the mail first time, it is asking for download pictures. I clicked to download pictures and the image getting displayed in the mail. After that, i close the mail(a popup window came for save changes yes or no.. i gave no) and deleted the image in application server. Now again when i try to open the mail second time(this time image is deleted in application server), same thing it is asking download pictures and after click image get displayed.

Scenario 2 :
Before open the mail first time, i deleted the image in application server and then opened the mail first time(image in application server is deleted now). It is asking for download pictures, when i click download pictures, image is not getting display in the mail.

Please help me to sort out the scenario 2. How to display the image when we open mail first time after deletion in application server?

+2  A: 

Why don't you attach the image to the message? This way it's not going anywhere.

You need to:

  • Attach the image file to the letter
  • Assign a content-id to that file by using Content-ID: [email protected] header
  • Refer it by cid: in tags, like: <img src="cid:[email protected]">.

See http://www.ietf.org/rfc/rfc2392.txt

alamar
I want to display the image in mail along with other content by default. Is it possible to do that?
You need to create a multipart message. The first part is the HTML, then after, append the images. Then everything will display together. Just look at some spam for examples of the MIME structure you need.
erickson