Sending Mail via SMTP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • MadCrazyNewbie

    Sending Mail via SMTP

    Hey group,

    Could anybody point me in the right direction for some hows to`s on how to
    send e-mail from VB?

    Basically want a form with 3 x textbox's on 1 for From, 1 for subject, and 1
    for message.

    Many Thanks
    MCN


  • Ken Tucker [MVP]

    #2
    Re: Sending Mail via SMTP

    Hi,



    Ken
    --------------
    "MadCrazyNewbie " <test@nospam.co m> wrote in message
    news:WeKcndRlN8 aexgbdSa8jmA@ka roo.co.uk...[color=blue]
    > Hey group,
    >
    > Could anybody point me in the right direction for some hows to`s on how to
    > send e-mail from VB?
    >
    > Basically want a form with 3 x textbox's on 1 for From, 1 for subject, and
    > 1
    > for message.
    >
    > Many Thanks
    > MCN
    >
    >[/color]


    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: Sending Mail via SMTP

      * "MadCrazyNewbie " <test@nospam.co m> scripsit:[color=blue]
      > Could anybody point me in the right direction for some hows to`s on how to
      > send e-mail from VB?
      >
      > Basically want a form with 3 x textbox's on 1 for From, 1 for subject, and 1
      > for message.[/color]

      My FAQ:

      Namespace 'System.Web.Mai l' (requires reference to "System.Web.dll "),
      FAQ: <URL:http://www.systemwebma il.net/>.

      CDO/Exchange:

      Support Policy for Microsoft Exchange APIs with .NET Framework Applications
      <URL:http://support.microso ft.com/?scid=kb;EN-US;813349>

      HOW TO: Retrieve Messages Using CDOEX and ADO in Visual C#
      <URL:http://support.microso ft.com/?scid=kb;EN-US;310206>

      Self-made:

      <URL:http://www.codeproject .com/csharp/karavaev_denis. asp>
      <URL:http://www.codeproject .com/csharp/popapp.asp>
      <URL:http://www.codeproject .com/csharp/pop3client.asp>

      SMTP and POP3 Mail Server
      <URL:http://www.codeproject .com/csharp/smtppop3mailser ver.asp>

      Commercial:

      <URL:http://www.abderaware. com/mail/>

      --
      Herfried K. Wagner [MVP]
      <URL:http://dotnet.mvps.org/>

      Comment

      • Piedro

        #4
        Re: Sending Mail via SMTP

        Hi

        this will get you started:

        at the top of your project
        Imports System.Web.Mail

        then the code behind for example a button

        try
        SmtpMail.SmtpSe rver = "XXX.XXX.XXX.XX X" IP of an smtp server
        Dim Message As MailMessage
        Message = New MailMessage()
        Message.From = txtFrom.text
        Message.To = txtTo.Text
        Message.Cc = txtcc.Text
        Message.Subject = txtSubject.Text
        Message.Body = txtMail.Text
        Message.BodyFor mat = MailFormat.Text
        SmtpMail.Send(M essage)
        catch ex as exception
        msgbox(ex.tostr ing)
        end try

        You can also attacht files but for the moment I haven't got time to
        give you that code, but looking for that yourself won't hurt you.

        HTH
        Gr Peter



        "MadCrazyNewbie " <test@nospam.co m> wrote in message news:<WeKcndRlN 8aexgbdSa8jmA@k aroo.co.uk>...[color=blue]
        > Hey group,
        >
        > Could anybody point me in the right direction for some hows to`s on how to
        > send e-mail from VB?
        >
        > Basically want a form with 3 x textbox's on 1 for From, 1 for subject, and 1
        > for message.
        >
        > Many Thanks
        > MCN[/color]

        Comment

        • MadCrazyNewbie

          #5
          Re: Sending Mail via SMTP

          Piedro, spot on exatly what I was after.

          Many Thanks
          MCN

          "Piedro" <pproost@hotmai l.com> wrote in message
          news:b7e3650a.0 405070602.97592 5f@posting.goog le.com...[color=blue]
          > Hi
          >
          > this will get you started:
          >
          > at the top of your project
          > Imports System.Web.Mail
          >
          > then the code behind for example a button
          >
          > try
          > SmtpMail.SmtpSe rver = "XXX.XXX.XXX.XX X" IP of an smtp server
          > Dim Message As MailMessage
          > Message = New MailMessage()
          > Message.From = txtFrom.text
          > Message.To = txtTo.Text
          > Message.Cc = txtcc.Text
          > Message.Subject = txtSubject.Text
          > Message.Body = txtMail.Text
          > Message.BodyFor mat = MailFormat.Text
          > SmtpMail.Send(M essage)
          > catch ex as exception
          > msgbox(ex.tostr ing)
          > end try
          >
          > You can also attacht files but for the moment I haven't got time to
          > give you that code, but looking for that yourself won't hurt you.
          >
          > HTH
          > Gr Peter
          >
          >
          >
          > "MadCrazyNewbie " <test@nospam.co m> wrote in message[/color]
          news:<WeKcndRlN 8aexgbdSa8jmA@k aroo.co.uk>...[color=blue][color=green]
          > > Hey group,
          > >
          > > Could anybody point me in the right direction for some hows to`s on how[/color][/color]
          to[color=blue][color=green]
          > > send e-mail from VB?
          > >
          > > Basically want a form with 3 x textbox's on 1 for From, 1 for subject,[/color][/color]
          and 1[color=blue][color=green]
          > > for message.
          > >
          > > Many Thanks
          > > MCN[/color][/color]


          Comment

          • Liz

            #6
            Re: Sending Mail via SMTP


            "Piedro" <pproost@hotmai l.com> wrote in message
            news:b7e3650a.0 405070602.97592 5f@posting.goog le.com...
            [color=blue]
            > Imports System.Web.Mail[/color]
            [color=blue]
            > try
            > SmtpMail.SmtpSe rver = "XXX.XXX.XXX.XX X" IP of an smtp server
            > Dim Message As MailMessage
            > Message = New MailMessage()
            > Message.From = txtFrom.text
            > Message.To = txtTo.Text
            > Message.Cc = txtcc.Text
            > Message.Subject = txtSubject.Text
            > Message.Body = txtMail.Text
            > Message.BodyFor mat = MailFormat.Text
            > SmtpMail.Send(M essage)
            > catch ex as exception
            > msgbox(ex.tostr ing)
            > end try[/color]

            anyone know how you can do this with authentication ?



            Comment

            • Piedro

              #7
              Re: Sending Mail via SMTP

              "Liz" <liz@tiredofspa m.com> wrote in message news:<#rcSDeINE HA.1348@TK2MSFT NGP12.phx.gbl>. ..[color=blue]
              > "Piedro" <pproost@hotmai l.com> wrote in message
              > news:b7e3650a.0 405070602.97592 5f@posting.goog le.com...
              >[color=green]
              > > Imports System.Web.Mail[/color]
              >[color=green]
              > > try
              > > SmtpMail.SmtpSe rver = "XXX.XXX.XXX.XX X" IP of an smtp server
              > > Dim Message As MailMessage
              > > Message = New MailMessage()
              > > Message.From = txtFrom.text
              > > Message.To = txtTo.Text
              > > Message.Cc = txtcc.Text
              > > Message.Subject = txtSubject.Text
              > > Message.Body = txtMail.Text
              > > Message.BodyFor mat = MailFormat.Text
              > > SmtpMail.Send(M essage)
              > > catch ex as exception
              > > msgbox(ex.tostr ing)
              > > end try[/color]
              >
              > anyone know how you can do this with authentication ?[/color]

              Hi Liz,

              look at the Herfieds' FAQ, everything is explained there perfectly.



              Gr Peter

              Comment

              • Liz

                #8
                Re: Sending Mail via SMTP


                "Piedro" <pproost@hotmai l.com> wrote in message
                news:b7e3650a.0 405092214.6c6cd 315@posting.goo gle.com...[color=blue]
                > "Liz" <liz@tiredofspa m.com> wrote in message[/color]
                news:<#rcSDeINE HA.1348@TK2MSFT NGP12.phx.gbl>. ..
                [color=blue][color=green][color=darkred]
                > > > Imports System.Web.Mail[/color]
                > >[color=darkred]
                > > > try
                > > > SmtpMail.SmtpSe rver = "XXX.XXX.XXX.XX X" IP of an smtp server
                > > > Dim Message As MailMessage
                > > > Message = New MailMessage()
                > > > Message.From = txtFrom.text
                > > > Message.To = txtTo.Text
                > > > Message.Cc = txtcc.Text
                > > > Message.Subject = txtSubject.Text
                > > > Message.Body = txtMail.Text
                > > > Message.BodyFor mat = MailFormat.Text
                > > > SmtpMail.Send(M essage)
                > > > catch ex as exception
                > > > msgbox(ex.tostr ing)
                > > > end try[/color]
                > >
                > > anyone know how you can do this with authentication ?[/color]
                >
                > Hi Liz,
                >
                > look at the Herfieds' FAQ, everything is explained there perfectly.
                >
                > http://www.systemwebmail.net/faq/3.8.aspx[/color]

                great FAQ ... and now my code works ! thanks ..




                Comment

                • Piedro

                  #9
                  Re: Sending Mail via SMTP

                  Sorry for the typo Herfried

                  :-)

                  pproost@hotmail .com (Piedro) wrote in message news:<b7e3650a. 0405092214.6c6c d315@posting.go ogle.com>...[color=blue]
                  > "Liz" <liz@tiredofspa m.com> wrote in message news:<#rcSDeINE HA.1348@TK2MSFT NGP12.phx.gbl>. ..[color=green]
                  > > "Piedro" <pproost@hotmai l.com> wrote in message
                  > > news:b7e3650a.0 405070602.97592 5f@posting.goog le.com...
                  > >[color=darkred]
                  > > > Imports System.Web.Mail[/color][/color]
                  >[color=green][color=darkred]
                  > > > try
                  > > > SmtpMail.SmtpSe rver = "XXX.XXX.XXX.XX X" IP of an smtp server
                  > > > Dim Message As MailMessage
                  > > > Message = New MailMessage()
                  > > > Message.From = txtFrom.text
                  > > > Message.To = txtTo.Text
                  > > > Message.Cc = txtcc.Text
                  > > > Message.Subject = txtSubject.Text
                  > > > Message.Body = txtMail.Text
                  > > > Message.BodyFor mat = MailFormat.Text
                  > > > SmtpMail.Send(M essage)
                  > > > catch ex as exception
                  > > > msgbox(ex.tostr ing)
                  > > > end try[/color]
                  > >
                  > > anyone know how you can do this with authentication ?[/color]
                  >
                  > Hi Liz,
                  >
                  > look at the Herfieds' FAQ, everything is explained there perfectly.
                  >
                  > http://www.systemwebmail.net/faq/3.8.aspx
                  >
                  > Gr Peter[/color]

                  Comment

                  • Herfried K. Wagner [MVP]

                    #10
                    Re: Sending Mail via SMTP

                    * pproost@hotmail .com (Piedro) scripsit:[color=blue]
                    > look at the Herfieds' FAQ, everything is explained there perfectly.
                    >
                    > http://www.systemwebmail.net/faq/3.8.aspx[/color]

                    It's actually /not/ my FAQ ;-).

                    --
                    Herfried K. Wagner [MVP]
                    <URL:http://dotnet.mvps.org/>

                    Comment

                    • Piedro

                      #11
                      Re: Sending Mail via SMTP

                      hirf-spam-me-here@gmx.at (Herfried K. Wagner [MVP]) wrote in message news:<2g98e6F2m epU1@uni-berlin.de>...[color=blue]
                      > * pproost@hotmail .com (Piedro) scripsit:[color=green]
                      > > look at the Herfieds' FAQ, everything is explained there perfectly.
                      > >
                      > > http://www.systemwebmail.net/faq/3.8.aspx[/color]
                      >
                      > It's actually /not/ my FAQ ;-).[/color]


                      I didn't say it was your FAQ, I said it was Herfieds' FAQ lol ;-)
                      Now I'm going to work

                      gr Peter

                      Comment

                      Working...