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. smpt Mail - Help Needed

smpt Mail - Help Needed

Scheduled Pinned Locked Moved Visual Basic
helpcsharpcomsysadminbeta-testing
12 Posts 10 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.
  • J Offline
    J Offline
    Jats_4ru
    wrote on last edited by
    #1

    Hi All - Need ur help Hi, I am jats working as a s/w Developer. I need some help from u. I am new to .net and using it from past 2 weeks. During my project i got a problem. My project has a requirement of sending mail to some mail a/c, when user clicks on a submit button. I wrote some code for it but i am getting a Inner Exception saying..... "Failure sending mail.Unable to read data from the transport connection:An existing connection was forcibly closed by the remote host" The code is as follows……… Private Sub SendMail() Dim smtpClient As SmtpClient Dim message As MailMessage Dim fromAddress As MailAddress smtpClient = New SmtpClient() message = New MailMessage() Try fromAddress = New MailAddress("from@xxx.com") smtpClient.Host = "Smtp Server string" smtpClient.Port = 25 message.From = fromAddress message.To.Add("to@xxx.com") message.Subject = "Feedback" message.Body = "This is Body Part" smtpClient.Send(message) '*****Raising Exception here***** MsgBox("Email successfully sent.") Catch ex As Exception MsgBox("Send Email Failed." + ex.Message + ex.InnerException.Message) End Try End Sub Note: I am not using any mail server is it neccesary to do so. If it is plz specify me One mail server. Plz send me some Document to relevent topic if u hav it. And ur suggesstion on this topic. Waiting for a positive response….. jats. jats_4ru@yahoo.co.in

    C H S S D 6 Replies Last reply
    0
    • J Jats_4ru

      Hi All - Need ur help Hi, I am jats working as a s/w Developer. I need some help from u. I am new to .net and using it from past 2 weeks. During my project i got a problem. My project has a requirement of sending mail to some mail a/c, when user clicks on a submit button. I wrote some code for it but i am getting a Inner Exception saying..... "Failure sending mail.Unable to read data from the transport connection:An existing connection was forcibly closed by the remote host" The code is as follows……… Private Sub SendMail() Dim smtpClient As SmtpClient Dim message As MailMessage Dim fromAddress As MailAddress smtpClient = New SmtpClient() message = New MailMessage() Try fromAddress = New MailAddress("from@xxx.com") smtpClient.Host = "Smtp Server string" smtpClient.Port = 25 message.From = fromAddress message.To.Add("to@xxx.com") message.Subject = "Feedback" message.Body = "This is Body Part" smtpClient.Send(message) '*****Raising Exception here***** MsgBox("Email successfully sent.") Catch ex As Exception MsgBox("Send Email Failed." + ex.Message + ex.InnerException.Message) End Try End Sub Note: I am not using any mail server is it neccesary to do so. If it is plz specify me One mail server. Plz send me some Document to relevent topic if u hav it. And ur suggesstion on this topic. Waiting for a positive response….. jats. jats_4ru@yahoo.co.in

      C Offline
      C Offline
      Chris Losinger
      wrote on last edited by
      #2

      Mr.Gundala wrote:

      Waiting for a positive response

      you should positively not post programming questions in The Lounge. Cleek | Image Toolkits | Thumbnail maker

      1 Reply Last reply
      0
      • J Jats_4ru

        Hi All - Need ur help Hi, I am jats working as a s/w Developer. I need some help from u. I am new to .net and using it from past 2 weeks. During my project i got a problem. My project has a requirement of sending mail to some mail a/c, when user clicks on a submit button. I wrote some code for it but i am getting a Inner Exception saying..... "Failure sending mail.Unable to read data from the transport connection:An existing connection was forcibly closed by the remote host" The code is as follows……… Private Sub SendMail() Dim smtpClient As SmtpClient Dim message As MailMessage Dim fromAddress As MailAddress smtpClient = New SmtpClient() message = New MailMessage() Try fromAddress = New MailAddress("from@xxx.com") smtpClient.Host = "Smtp Server string" smtpClient.Port = 25 message.From = fromAddress message.To.Add("to@xxx.com") message.Subject = "Feedback" message.Body = "This is Body Part" smtpClient.Send(message) '*****Raising Exception here***** MsgBox("Email successfully sent.") Catch ex As Exception MsgBox("Send Email Failed." + ex.Message + ex.InnerException.Message) End Try End Sub Note: I am not using any mail server is it neccesary to do so. If it is plz specify me One mail server. Plz send me some Document to relevent topic if u hav it. And ur suggesstion on this topic. Waiting for a positive response….. jats. jats_4ru@yahoo.co.in

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        one question Visual Basic in Lounge!_**


        **_

        whitesky


        1 Reply Last reply
        0
        • J Jats_4ru

          Hi All - Need ur help Hi, I am jats working as a s/w Developer. I need some help from u. I am new to .net and using it from past 2 weeks. During my project i got a problem. My project has a requirement of sending mail to some mail a/c, when user clicks on a submit button. I wrote some code for it but i am getting a Inner Exception saying..... "Failure sending mail.Unable to read data from the transport connection:An existing connection was forcibly closed by the remote host" The code is as follows……… Private Sub SendMail() Dim smtpClient As SmtpClient Dim message As MailMessage Dim fromAddress As MailAddress smtpClient = New SmtpClient() message = New MailMessage() Try fromAddress = New MailAddress("from@xxx.com") smtpClient.Host = "Smtp Server string" smtpClient.Port = 25 message.From = fromAddress message.To.Add("to@xxx.com") message.Subject = "Feedback" message.Body = "This is Body Part" smtpClient.Send(message) '*****Raising Exception here***** MsgBox("Email successfully sent.") Catch ex As Exception MsgBox("Send Email Failed." + ex.Message + ex.InnerException.Message) End Try End Sub Note: I am not using any mail server is it neccesary to do so. If it is plz specify me One mail server. Plz send me some Document to relevent topic if u hav it. And ur suggesstion on this topic. Waiting for a positive response….. jats. jats_4ru@yahoo.co.in

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

          Sorry, this site is about soccer only. You should try to post your programming questions on the FIFA[^] website :)

          J A 2 Replies Last reply
          0
          • S Stlan

            Sorry, this site is about soccer only. You should try to post your programming questions on the FIFA[^] website :)

            J Offline
            J Offline
            J4amieC
            wrote on last edited by
            #5

            :laugh: Current blacklist svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour

            1 Reply Last reply
            0
            • S Stlan

              Sorry, this site is about soccer only. You should try to post your programming questions on the FIFA[^] website :)

              A Offline
              A Offline
              AbhishekBK
              wrote on last edited by
              #6

              Stlan wrote:

              Sorry, this site is about soccer only. You should try to post your programming questions on the FIFA[^] website

              :laugh: Actually he's proably done worse by posting it in the lounge. FIFA would have been a little more considerate. Abhishek

              1 Reply Last reply
              0
              • J Jats_4ru

                Hi All - Need ur help Hi, I am jats working as a s/w Developer. I need some help from u. I am new to .net and using it from past 2 weeks. During my project i got a problem. My project has a requirement of sending mail to some mail a/c, when user clicks on a submit button. I wrote some code for it but i am getting a Inner Exception saying..... "Failure sending mail.Unable to read data from the transport connection:An existing connection was forcibly closed by the remote host" The code is as follows……… Private Sub SendMail() Dim smtpClient As SmtpClient Dim message As MailMessage Dim fromAddress As MailAddress smtpClient = New SmtpClient() message = New MailMessage() Try fromAddress = New MailAddress("from@xxx.com") smtpClient.Host = "Smtp Server string" smtpClient.Port = 25 message.From = fromAddress message.To.Add("to@xxx.com") message.Subject = "Feedback" message.Body = "This is Body Part" smtpClient.Send(message) '*****Raising Exception here***** MsgBox("Email successfully sent.") Catch ex As Exception MsgBox("Send Email Failed." + ex.Message + ex.InnerException.Message) End Try End Sub Note: I am not using any mail server is it neccesary to do so. If it is plz specify me One mail server. Plz send me some Document to relevent topic if u hav it. And ur suggesstion on this topic. Waiting for a positive response….. jats. jats_4ru@yahoo.co.in

                S Offline
                S Offline
                Super Lloyd
                wrote on last edited by
                #7

                Mr.Gundala wrote:

                message.Body = "This is Body Part"

                here you have your error! it should be either: message.Body = "This is the whole Body." or message.BodyPart = "This is a Limb."

                G 1 Reply Last reply
                0
                • S Super Lloyd

                  Mr.Gundala wrote:

                  message.Body = "This is Body Part"

                  here you have your error! it should be either: message.Body = "This is the whole Body." or message.BodyPart = "This is a Limb."

                  G Offline
                  G Offline
                  Graham Bradshaw
                  wrote on last edited by
                  #8

                  He's asking for help. Maybe you should give him a hand... :-D

                  1 Reply Last reply
                  0
                  • J Jats_4ru

                    Hi All - Need ur help Hi, I am jats working as a s/w Developer. I need some help from u. I am new to .net and using it from past 2 weeks. During my project i got a problem. My project has a requirement of sending mail to some mail a/c, when user clicks on a submit button. I wrote some code for it but i am getting a Inner Exception saying..... "Failure sending mail.Unable to read data from the transport connection:An existing connection was forcibly closed by the remote host" The code is as follows……… Private Sub SendMail() Dim smtpClient As SmtpClient Dim message As MailMessage Dim fromAddress As MailAddress smtpClient = New SmtpClient() message = New MailMessage() Try fromAddress = New MailAddress("from@xxx.com") smtpClient.Host = "Smtp Server string" smtpClient.Port = 25 message.From = fromAddress message.To.Add("to@xxx.com") message.Subject = "Feedback" message.Body = "This is Body Part" smtpClient.Send(message) '*****Raising Exception here***** MsgBox("Email successfully sent.") Catch ex As Exception MsgBox("Send Email Failed." + ex.Message + ex.InnerException.Message) End Try End Sub Note: I am not using any mail server is it neccesary to do so. If it is plz specify me One mail server. Plz send me some Document to relevent topic if u hav it. And ur suggesstion on this topic. Waiting for a positive response….. jats. jats_4ru@yahoo.co.in

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

                    Mr.Gundala wrote:

                    Note: I am not using any mail server is it neccesary to do so.

                    Well, now that the Lounge Lizards are done smacking you around... "smtpClient.Host = "Smtp Server string"" says you are using a mail server, if and only if "Smtp Server string" actually resolves to something useful, and yes, a mail server is required. But, since you're getting a "An existing connection was forcibly closed by the remote host" error, it would appear that the SMTP server you're using doesn't like you for some reason and is hanging up on you. You might want to find out from whoever owns the server, why. Dave Kreskowiak Microsoft MVP - Visual Basic -- modified at 10:58 Tuesday 27th June, 2006

                    J 1 Reply Last reply
                    0
                    • J Jats_4ru

                      Hi All - Need ur help Hi, I am jats working as a s/w Developer. I need some help from u. I am new to .net and using it from past 2 weeks. During my project i got a problem. My project has a requirement of sending mail to some mail a/c, when user clicks on a submit button. I wrote some code for it but i am getting a Inner Exception saying..... "Failure sending mail.Unable to read data from the transport connection:An existing connection was forcibly closed by the remote host" The code is as follows……… Private Sub SendMail() Dim smtpClient As SmtpClient Dim message As MailMessage Dim fromAddress As MailAddress smtpClient = New SmtpClient() message = New MailMessage() Try fromAddress = New MailAddress("from@xxx.com") smtpClient.Host = "Smtp Server string" smtpClient.Port = 25 message.From = fromAddress message.To.Add("to@xxx.com") message.Subject = "Feedback" message.Body = "This is Body Part" smtpClient.Send(message) '*****Raising Exception here***** MsgBox("Email successfully sent.") Catch ex As Exception MsgBox("Send Email Failed." + ex.Message + ex.InnerException.Message) End Try End Sub Note: I am not using any mail server is it neccesary to do so. If it is plz specify me One mail server. Plz send me some Document to relevent topic if u hav it. And ur suggesstion on this topic. Waiting for a positive response….. jats. jats_4ru@yahoo.co.in

                      E Offline
                      E Offline
                      Edbert P
                      wrote on last edited by
                      #10

                      As Dave said above, and also you might want to check if you have a virus scanner running. It usually blocks port 25 which gives you that "An existing connection was forcibly closed by the remote host". "Democracy is two wolves and a sheep voting on what to have for dinner" - Ross Edbert Sydney, Australia

                      J 1 Reply Last reply
                      0
                      • D Dave Kreskowiak

                        Mr.Gundala wrote:

                        Note: I am not using any mail server is it neccesary to do so.

                        Well, now that the Lounge Lizards are done smacking you around... "smtpClient.Host = "Smtp Server string"" says you are using a mail server, if and only if "Smtp Server string" actually resolves to something useful, and yes, a mail server is required. But, since you're getting a "An existing connection was forcibly closed by the remote host" error, it would appear that the SMTP server you're using doesn't like you for some reason and is hanging up on you. You might want to find out from whoever owns the server, why. Dave Kreskowiak Microsoft MVP - Visual Basic -- modified at 10:58 Tuesday 27th June, 2006

                        J Offline
                        J Offline
                        Jats_4ru
                        wrote on last edited by
                        #11

                        Thanku very much. I will check the server... jats

                        1 Reply Last reply
                        0
                        • E Edbert P

                          As Dave said above, and also you might want to check if you have a virus scanner running. It usually blocks port 25 which gives you that "An existing connection was forcibly closed by the remote host". "Democracy is two wolves and a sheep voting on what to have for dinner" - Ross Edbert Sydney, Australia

                          J Offline
                          J Offline
                          Jats_4ru
                          wrote on last edited by
                          #12

                          I do have a virus scanner. Its Norton.... I will check that too. Thanks for the help.

                          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