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. mail sending problem through gmail account

mail sending problem through gmail account

Scheduled Pinned Locked Moved ASP.NET
helpcsharpsysadminasp-netcom
2 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.
  • P Offline
    P Offline
    prateekfgiet
    wrote on last edited by
    #1

    hi, i m using asp.net c# and i m trying to send mail via gmail account code is MailMessage message = new MailMessage(); message.From = new MailAddress("prtaeekfgiet@gmail.com"); message.To.Add(new MailAddress("rma.maksat@gmail.com")); //message.To.Add(new MailAddress("recipient2@foo.bar.com")); //message.To.Add(new MailAddress("recipient3@foo.bar.com")); //message.CC.Add(new MailAddress("carboncopy@foo.bar.com")); message.Subject = "This is my subject"; message.Body = "This is the content"; SmtpClient client = new SmtpClient(); client.Send(message); <system.net> <mailSettings> <smtp from="prateekfgiet@gmail.com"> <network host="smtp.gmail.com" port="587" userName="prateekfgiet" password="password" defaultCredentials="true" /> </smtp> </mailSettings> but its give error error is System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first. k2sm932784rvb.8 pls help me

    V 1 Reply Last reply
    0
    • P prateekfgiet

      hi, i m using asp.net c# and i m trying to send mail via gmail account code is MailMessage message = new MailMessage(); message.From = new MailAddress("prtaeekfgiet@gmail.com"); message.To.Add(new MailAddress("rma.maksat@gmail.com")); //message.To.Add(new MailAddress("recipient2@foo.bar.com")); //message.To.Add(new MailAddress("recipient3@foo.bar.com")); //message.CC.Add(new MailAddress("carboncopy@foo.bar.com")); message.Subject = "This is my subject"; message.Body = "This is the content"; SmtpClient client = new SmtpClient(); client.Send(message); <system.net> <mailSettings> <smtp from="prateekfgiet@gmail.com"> <network host="smtp.gmail.com" port="587" userName="prateekfgiet" password="password" defaultCredentials="true" /> </smtp> </mailSettings> but its give error error is System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first. k2sm932784rvb.8 pls help me

      V Offline
      V Offline
      Vasudevan Deepak Kumar
      wrote on last edited by
      #2

      Check out this post http://social.msdn.microsoft.com/forums/en-US/netfxnetcom/thread/26745216-962b-47db-bf13-4f2b159731ba/[^]

      Vasudevan Deepak Kumar Personal Homepage
      Tech Gossips
      The woods are lovely, dark and deep, But I have promises to keep, And miles to go before I sleep, And miles to go before I sleep!

      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