Menu

How to inline images in html body ?

Help
DaberElay
2004-07-27
2013-04-15
  • DaberElay

    DaberElay - 2004-07-27

    I would like to use the images inlined in the html body of the message but they appear as attachments.

    how do i do that?

    thanks.

     
    • Anonymous

      Anonymous - 2004-07-30

      When I want to put a background image I did create a HTML page with my pictures and use M$ OutLook Express to send email using.... Then I save email like .EML, In .eml file the images was converted in Html Boy/part

      Hope this help

       
    • DDAY

      DDAY - 2004-09-03

      It is not possible to simply reference the images in the html used to send the email?

       
    • Joe

      Joe - 2004-12-14

      The src attribute of you image tag needs to refer to the image attachment that you created.  You will notice the AddImage method has an option to provide a contentId.  You should specify the contentId and then use this as your for your Image source.  Instead of
      MailMessage.AddImage("myFile.gif");  use
      MailMessae.AddImage("myFile.gif","myImage1");

      and you HTML will be
      <IMG  src="cid:myImage1" >

      Note that if you use lotus notes it does not like the lowercase "cid"  and wants an uppercase "CID"  (or vice-versa, I can't remember which) .  Whichever MS-Outlook likes the other.  So if you are in the same situation as I am, and have a mix of Notes users and MS-Outlook or other mail client users  you can get around this by providing 2 src attributes in your tag.

      <IMG src="cid:myImage1" SRC=CID:"myImage1">  Case sensitivity works great.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.