Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Sending images in html mail

Sending images in html mail

Scheduled Pinned Locked Moved C#
htmlhelpquestion
2 Posts 2 Posters 18 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Henk
    wrote on last edited by
    #1

    Hello, I have the follwing code: public static void SendNewsletter ( string Address, StringCollection scPictures, string Text ) { MailMessage mm = new MailMessage(); mm.To = Address; mm.Body = Text; mm.From = "XXX@XXX.coml"; mm.Subject = "Your weekly newsletter"; mm.BodyFormat = MailFormat.Html; foreach ( string s in scPictures ) mm.Attachments.Add ( new MailAttachment (s)); SmtpMail.Send ( mm ); } In outlook and outlook express the images appear just in the HTML and the recipent gets to see perfect HTML page, but the images also appear as seperate attachements!!! When I get newsletters in HTML hte attachmetns are never visible! What am I doing wrong? Any help appreciated Henk

    S 1 Reply Last reply
    0
    • H Henk

      Hello, I have the follwing code: public static void SendNewsletter ( string Address, StringCollection scPictures, string Text ) { MailMessage mm = new MailMessage(); mm.To = Address; mm.Body = Text; mm.From = "XXX@XXX.coml"; mm.Subject = "Your weekly newsletter"; mm.BodyFormat = MailFormat.Html; foreach ( string s in scPictures ) mm.Attachments.Add ( new MailAttachment (s)); SmtpMail.Send ( mm ); } In outlook and outlook express the images appear just in the HTML and the recipent gets to see perfect HTML page, but the images also appear as seperate attachements!!! When I get newsletters in HTML hte attachmetns are never visible! What am I doing wrong? Any help appreciated Henk

      S Offline
      S Offline
      Steve Maier
      wrote on last edited by
      #2

      Well from your code, you are attaching the images as attachments. Outlook Express will preview a picture attachment for you, that is why you are seeing it in the message. Typically what html newsleters do is have a full html page that is sent and the images are not in the mail message, but usually they refer to a web server. This keeps the email messages small. Steve Maier, MCSD

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups