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
8 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
    sumit21
    wrote on last edited by
    #1

    i m making an application in wich i need to send mail can anyone plz help me remember there is no namespace "system.web" and there is no class smtpmailmessage in vb.net plz help a code will be more helpful

    C R 2 Replies Last reply
    0
    • S sumit21

      i m making an application in wich i need to send mail can anyone plz help me remember there is no namespace "system.web" and there is no class smtpmailmessage in vb.net plz help a code will be more helpful

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      System.Web.Mail.SmtpMail.Send is what you need. What do you mean there is no System.Web namespace ? Of course there is. Christian Graus - Microsoft MVP - C++

      S 1 Reply Last reply
      0
      • S sumit21

        i m making an application in wich i need to send mail can anyone plz help me remember there is no namespace "system.web" and there is no class smtpmailmessage in vb.net plz help a code will be more helpful

        R Offline
        R Offline
        Ray Cassick
        wrote on last edited by
        #3

        Make sure you have the proper DLL referenced in your project or the Import statement will not work.


        George Carlin wrote: "Don't sweat the petty things, and don't pet the sweaty things." Jörgen Sigvardsson wrote: If the physicists find a universal theory describing the laws of universe, I'm sure the asshole constant will be an integral part of that theory.
        My Blog[^]


        1 Reply Last reply
        0
        • C Christian Graus

          System.Web.Mail.SmtpMail.Send is what you need. What do you mean there is no System.Web namespace ? Of course there is. Christian Graus - Microsoft MVP - C++

          S Offline
          S Offline
          sumit21
          wrote on last edited by
          #4

          this i valid namespace in c# but in vb.net there is no namespace with this name. u can try it out

          D C 2 Replies Last reply
          0
          • S sumit21

            this i valid namespace in c# but in vb.net there is no namespace with this name. u can try it out

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

            You're very mistaken. All you have to do is add a Reference to the System.Web .DLL and the namespace will work. C# has to do the exact same thing. As a matter of fact, ALL the managed languages under .NET have to do this to get access to the System.Web namespace. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

            S 1 Reply Last reply
            0
            • S sumit21

              this i valid namespace in c# but in vb.net there is no namespace with this name. u can try it out

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              Yeah, I thought you may have forgotten the reference. Christian Graus - Microsoft MVP - C++

              1 Reply Last reply
              0
              • D Dave Kreskowiak

                You're very mistaken. All you have to do is add a Reference to the System.Web .DLL and the namespace will work. C# has to do the exact same thing. As a matter of fact, ALL the managed languages under .NET have to do this to get access to the System.Web namespace. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

                S Offline
                S Offline
                sumit21
                wrote on last edited by
                #7

                where should i browse that dll? i need to add refrence but i cant locate that file

                D 1 Reply Last reply
                0
                • S sumit21

                  where should i browse that dll? i need to add refrence but i cant locate that file

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

                  You don't have to locate the file. Just right-click the References folder, then click on Add Reference. When the dialog shows up, it'll list, on the .NET tab, all the .NET components in the GAC. Scroll down the list and you'll find System.Web.dll. Double-click it, then click OK. You can then use the Imports statement to import the namespaces you need. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

                  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