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. Visual Basic
  4. Sending Email With an Attachment

Sending Email With an Attachment

Scheduled Pinned Locked Moved Visual Basic
comhelpquestion
3 Posts 3 Posters 0 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.
  • M Offline
    M Offline
    multi_plu
    wrote on last edited by
    #1

    Hi, Who can I send email with an attachment? This is the code witchh I use but it don't work. Something missing? Dim oMsg As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage() oMsg.From = "noone@nobody.com" oMsg.To = "someone@somewhere.com" oMsg.Subject = "Email with Attachment Demo" oMsg.Body = "This is the main body of the email" Dim oAttch As MailAttachment = New MailAttachment("C:\myattachment.zip") oMsg.Attachments.Add(oAttch) SmtpMail.Send(oMsg) Please help me! Thanx anyway.

    T T 2 Replies Last reply
    0
    • M multi_plu

      Hi, Who can I send email with an attachment? This is the code witchh I use but it don't work. Something missing? Dim oMsg As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage() oMsg.From = "noone@nobody.com" oMsg.To = "someone@somewhere.com" oMsg.Subject = "Email with Attachment Demo" oMsg.Body = "This is the main body of the email" Dim oAttch As MailAttachment = New MailAttachment("C:\myattachment.zip") oMsg.Attachments.Add(oAttch) SmtpMail.Send(oMsg) Please help me! Thanx anyway.

      T Offline
      T Offline
      TadejK
      wrote on last edited by
      #2

      If you intend to send many e-mails and with more functionality than is included in .NET framework, you should look at the Indy project . Regards, Tadej

      1 Reply Last reply
      0
      • M multi_plu

        Hi, Who can I send email with an attachment? This is the code witchh I use but it don't work. Something missing? Dim oMsg As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage() oMsg.From = "noone@nobody.com" oMsg.To = "someone@somewhere.com" oMsg.Subject = "Email with Attachment Demo" oMsg.Body = "This is the main body of the email" Dim oAttch As MailAttachment = New MailAttachment("C:\myattachment.zip") oMsg.Attachments.Add(oAttch) SmtpMail.Send(oMsg) Please help me! Thanx anyway.

        T Offline
        T Offline
        ToddHileHoffer
        wrote on last edited by
        #3

        You didn't set the smtp sever property. What error are you getting? "People who never make mistakes, never do anything." My Blog

        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