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. Web Development
  3. ASP.NET
  4. Why the email could not be sent?

Why the email could not be sent?

Scheduled Pinned Locked Moved ASP.NET
question
5 Posts 2 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.
  • R Offline
    R Offline
    rushing
    wrote on last edited by
    #1

    public static void SendMail(string receiver,string subject,string content) { MailAddress from = new MailAddress("aa@aa.cn", "aa", System.Text.Encoding.UTF8); MailAddress to = new MailAddress(receiver); MailMessage mm = new MailMessage(from, to); mm.Subject = subject; mm.SubjectEncoding = System.Text.Encoding.UTF8; mm.Body = content; mm.BodyEncoding = System.Text.Encoding.UTF8; SmtpClient client = new SmtpClient("smtp.xxx.xx"); client.Credentials = new NetworkCredential("aa", "xxxx"); client.Send(mm); }

    G R 2 Replies Last reply
    0
    • R rushing

      public static void SendMail(string receiver,string subject,string content) { MailAddress from = new MailAddress("aa@aa.cn", "aa", System.Text.Encoding.UTF8); MailAddress to = new MailAddress(receiver); MailMessage mm = new MailMessage(from, to); mm.Subject = subject; mm.SubjectEncoding = System.Text.Encoding.UTF8; mm.Body = content; mm.BodyEncoding = System.Text.Encoding.UTF8; SmtpClient client = new SmtpClient("smtp.xxx.xx"); client.Credentials = new NetworkCredential("aa", "xxxx"); client.Send(mm); }

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Don't just post code without an explanation of the problem. What do you mean when you say that the email could not be sent? Do you get an error message? Do you get a delivery status notification? --- b { font-weight: normal; }

      R 1 Reply Last reply
      0
      • R rushing

        public static void SendMail(string receiver,string subject,string content) { MailAddress from = new MailAddress("aa@aa.cn", "aa", System.Text.Encoding.UTF8); MailAddress to = new MailAddress(receiver); MailMessage mm = new MailMessage(from, to); mm.Subject = subject; mm.SubjectEncoding = System.Text.Encoding.UTF8; mm.Body = content; mm.BodyEncoding = System.Text.Encoding.UTF8; SmtpClient client = new SmtpClient("smtp.xxx.xx"); client.Credentials = new NetworkCredential("aa", "xxxx"); client.Send(mm); }

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

        Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Net.Sockets.SocketException: The software in your host gave up a established connection.

        G 1 Reply Last reply
        0
        • G Guffa

          Don't just post code without an explanation of the problem. What do you mean when you say that the email could not be sent? Do you get an error message? Do you get a delivery status notification? --- b { font-weight: normal; }

          R Offline
          R Offline
          rushing
          wrote on last edited by
          #4

          Thanks for the hint. I have given some error details.

          1 Reply Last reply
          0
          • R rushing

            Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Net.Sockets.SocketException: The software in your host gave up a established connection.

            G Offline
            G Offline
            Guffa
            wrote on last edited by
            #5

            Google found me this: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=278644&SiteID=1[^] Perhaps you have the same problem. --- b { font-weight: normal; }

            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