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. ASP.NET send mail through gmail

ASP.NET send mail through gmail

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netcomsysadminbeta-testing
4 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.
  • A Offline
    A Offline
    Amit Battan Ror
    wrote on last edited by
    #1

    I use the follwing code in ASP.NET 2008 its working well but not working in 2005 String server = "smtp.gmail.com"; SmtpClient SmtpServer = new SmtpClient(); SmtpServer.Credentials = new System.Net.NetworkCredential(TextBox2.Text, TextBox3.Text); SmtpServer.Port = 587; SmtpServer.Host = server; SmtpServer.EnableSsl = true; MailMessage mail; mail = new MailMessage(); mail.From = new MailAddress(TextBox2.Text, TextBox1.Text, System.Text.Encoding.UTF8); mail.To.Add("skbataan@gmail.com"); mail.Subject = "FeedBack"; mail.Body = TextBox4.Text; mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure; SmtpServer.Send(mail); Any Solution

    Amit Battan Ror battan20@gmail.com

    L P C 3 Replies Last reply
    0
    • A Amit Battan Ror

      I use the follwing code in ASP.NET 2008 its working well but not working in 2005 String server = "smtp.gmail.com"; SmtpClient SmtpServer = new SmtpClient(); SmtpServer.Credentials = new System.Net.NetworkCredential(TextBox2.Text, TextBox3.Text); SmtpServer.Port = 587; SmtpServer.Host = server; SmtpServer.EnableSsl = true; MailMessage mail; mail = new MailMessage(); mail.From = new MailAddress(TextBox2.Text, TextBox1.Text, System.Text.Encoding.UTF8); mail.To.Add("skbataan@gmail.com"); mail.Subject = "FeedBack"; mail.Body = TextBox4.Text; mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure; SmtpServer.Send(mail); Any Solution

      Amit Battan Ror battan20@gmail.com

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      Amit Battan Ror wrote:

      but not working in 2005

      What does "not working" mean? Read the first message in the forum "How to get an answer to your question", pay attention to item #2. Also here are some handy forum guidelines[^]

      led mike

      1 Reply Last reply
      0
      • A Amit Battan Ror

        I use the follwing code in ASP.NET 2008 its working well but not working in 2005 String server = "smtp.gmail.com"; SmtpClient SmtpServer = new SmtpClient(); SmtpServer.Credentials = new System.Net.NetworkCredential(TextBox2.Text, TextBox3.Text); SmtpServer.Port = 587; SmtpServer.Host = server; SmtpServer.EnableSsl = true; MailMessage mail; mail = new MailMessage(); mail.From = new MailAddress(TextBox2.Text, TextBox1.Text, System.Text.Encoding.UTF8); mail.To.Add("skbataan@gmail.com"); mail.Subject = "FeedBack"; mail.Body = TextBox4.Text; mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure; SmtpServer.Send(mail); Any Solution

        Amit Battan Ror battan20@gmail.com

        P Offline
        P Offline
        Paul Conrad
        wrote on last edited by
        #3

        Amit Battan Ror wrote:

        but not working in 2005

        As led mike said, what do you mean by "not working"? Be more clear and someone may help you out.

        "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham

        1 Reply Last reply
        0
        • A Amit Battan Ror

          I use the follwing code in ASP.NET 2008 its working well but not working in 2005 String server = "smtp.gmail.com"; SmtpClient SmtpServer = new SmtpClient(); SmtpServer.Credentials = new System.Net.NetworkCredential(TextBox2.Text, TextBox3.Text); SmtpServer.Port = 587; SmtpServer.Host = server; SmtpServer.EnableSsl = true; MailMessage mail; mail = new MailMessage(); mail.From = new MailAddress(TextBox2.Text, TextBox1.Text, System.Text.Encoding.UTF8); mail.To.Add("skbataan@gmail.com"); mail.Subject = "FeedBack"; mail.Body = TextBox4.Text; mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure; SmtpServer.Send(mail); Any Solution

          Amit Battan Ror battan20@gmail.com

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

          Why on earth does your code have Textbox1 and Textbox2 ? How is that readable ?

          Christian Graus Driven to the arms of OSX by Vista.

          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