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. how to send mail through vb.net ?

how to send mail through vb.net ?

Scheduled Pinned Locked Moved Visual Basic
csharphelptutorialquestion
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.
  • S Offline
    S Offline
    sumit21
    wrote on last edited by
    #1

    i want to make an applicaton ( in VB.NET) through which i can send mail i also want to add option of "cc" and "bcc" and also of attaching files is, there any method in vb.net to send mails plz help me as i m new in this field. a code will be very useful

    A R 2 Replies Last reply
    0
    • S sumit21

      i want to make an applicaton ( in VB.NET) through which i can send mail i also want to add option of "cc" and "bcc" and also of attaching files is, there any method in vb.net to send mails plz help me as i m new in this field. a code will be very useful

      A Offline
      A Offline
      Adam Wimsatt
      wrote on last edited by
      #2

      yup.. it's fairly simple... take a look at the documentation for System.Web.Mail here's a c# example: using System.Web.Mail; ... SmtpMail.SmtpServer = "relayserveraddress"; MailMessage msg = new MailMessage(); msg.From = "from@youraddress.com"; msg.To = "to@them.com"; msg.bcc = "bcc@bcc.bcc"; msg.cc = "cc@cc.cc"; msg.Subject = "test message"; msg.Body = "this is the body of your message Formatted with HTML"; msg.BodyFormat = MailFormat.html; SmtpMail.Send(msg); That's all there is to it. Your code has to have relay access to the smtp server. Adam


      // TODO: Write code.

      1 Reply Last reply
      0
      • S sumit21

        i want to make an applicaton ( in VB.NET) through which i can send mail i also want to add option of "cc" and "bcc" and also of attaching files is, there any method in vb.net to send mails plz help me as i m new in this field. a code will be very useful

        R Offline
        R Offline
        rikpak
        wrote on last edited by
        #3

        Use the System.Web.Mail.MailMessage object. This is an example in C# of how to use it, but it should easily convert to VB.NET: MailMessage mail = new System.Web.Mail.MailMessage(); mail.From = ***sender's email address***; mail.To = ***reciever's email address; mail.Subject = ***Subject***; mail.Body= ***some message***; System.Web.Mail.SmtpMail.SmtpServer = ***your email server***; System.Web.Mail.SmtpMail.Send(mail); You can .cc, .bcc, and .attachments, as well. Hope this helps

        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