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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. How to send email using vb?

How to send email using vb?

Scheduled Pinned Locked Moved Visual Basic
helptutorialquestion
7 Posts 4 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
    Shirazpasha
    wrote on last edited by
    #1

    I have to develop a vb appln that sends email to some people at regular intervals. It should start executing at the os startup and remain active forever. At a particular time, it should send an email to some recipients. Pls it is a bit urgent, can somebody help me? Thanks in advance,

    Pasha

    V 1 Reply Last reply
    0
    • S Shirazpasha

      I have to develop a vb appln that sends email to some people at regular intervals. It should start executing at the os startup and remain active forever. At a particular time, it should send an email to some recipients. Pls it is a bit urgent, can somebody help me? Thanks in advance,

      Pasha

      V Offline
      V Offline
      vbdotnetcoder2005
      wrote on last edited by
      #2

      This is for VS 2003 and it looks like it has changed for VS2005. Here is some code to get you started. Look on MSDN for more class documentation. Dim email As New System.Web.Mail.MailMessage Dim EmailSrv As System.Web.Mail.SmtpMail email.To = "youremail@yourcompany.com" email.From = "youremail@yourcompany.com" email.BodyFormat = Web.Mail.MailFormat.Html email.Body = "Testing" email.Subject = "Test Email" EmailSrv.SmtpServer = "email.yourcompany.com" EmailSrv.Send(email)

      D 1 Reply Last reply
      0
      • V vbdotnetcoder2005

        This is for VS 2003 and it looks like it has changed for VS2005. Here is some code to get you started. Look on MSDN for more class documentation. Dim email As New System.Web.Mail.MailMessage Dim EmailSrv As System.Web.Mail.SmtpMail email.To = "youremail@yourcompany.com" email.From = "youremail@yourcompany.com" email.BodyFormat = Web.Mail.MailFormat.Html email.Body = "Testing" email.Subject = "Test Email" EmailSrv.SmtpServer = "email.yourcompany.com" EmailSrv.Send(email)

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        For VS2005, use the System.**Net**.Mail namespace instead. The System.Web.Mail namespace has been deprecated.

        Dave Kreskowiak Microsoft MVP - Visual Basic

        F 1 Reply Last reply
        0
        • D Dave Kreskowiak

          For VS2005, use the System.**Net**.Mail namespace instead. The System.Web.Mail namespace has been deprecated.

          Dave Kreskowiak Microsoft MVP - Visual Basic

          F Offline
          F Offline
          Freddie Code
          wrote on last edited by
          #4

          Does this approach require a Mail Server running on the same machine as the application?

          D 1 Reply Last reply
          0
          • F Freddie Code

            Does this approach require a Mail Server running on the same machine as the application?

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            No. You supply the DNS name or IP address of a valid SMTP server to the SmtpClient[^] class.

            Dave Kreskowiak Microsoft MVP - Visual Basic

            S 1 Reply Last reply
            0
            • D Dave Kreskowiak

              No. You supply the DNS name or IP address of a valid SMTP server to the SmtpClient[^] class.

              Dave Kreskowiak Microsoft MVP - Visual Basic

              S Offline
              S Offline
              Shirazpasha
              wrote on last edited by
              #6

              Thanks for the answer. But my development platform is vb 6.0 and not VB.Net Thanks,

              Pasha

              D 1 Reply Last reply
              0
              • S Shirazpasha

                Thanks for the answer. But my development platform is vb 6.0 and not VB.Net Thanks,

                Pasha

                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #7

                You should have mentioned that in the original post. VB.NET is usually assumed if nothing is said about which version you're using. You can use the MAPISession[^] and MAPIMessages[^] ActiveX controls to do this. I don't have any example code on how to use them though. A simple Google for "vb6 mapisession mapimessages" reveals this[^] list of possibilities.

                Dave Kreskowiak Microsoft MVP - Visual Basic

                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