Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 162719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:26:28+00:00 2026-05-11T11:26:28+00:00

For some reason neither the accepted answer nor any others work for me for

  • 0

For some reason neither the accepted answer nor any others work for me for ‘Sending email in .NET through Gmail‘. Why would they not work?

UPDATE: I have tried all the answers (accepted and otherwise) in the other question, but none of them work.

I would just like to know if it works for anyone else, otherwise Google may have changed something (which has happened before).

When I try the piece of code that uses SmtpDeliveryMethod.Network, I quickly receive an SmtpException on Send(message). The message is

The SMTP server requires a secure connection or the client was not authenticated.

The server response was:

5.5.1 Authentication Required. Learn more at’ <– seriously, it ends there.

UPDATE:

This is a question that I asked a long time ago, and the accepted answer is code that I’ve used many, many times on different projects.

I’ve taken some of the ideas in this post and other EmailSender projects to create an EmailSender project at Codeplex. It’s designed for testability and supports my favourite SMTP services such as GoDaddy and Gmail.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T11:26:29+00:00Added an answer on May 11, 2026 at 11:26 am

    CVertex, make sure to review your code, and, if that doesn’t reveal anything, post it. I was just enabling this on a test ASP.NET site I was working on, and it works.

    Actually, at some point I had an issue on my code. I didn’t spot it until I had a simpler version on a console program and saw it was working (no change on the Gmail side as you were worried about). The below code works just like the samples you referred to:

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net.Mail; using System.Net;  namespace ConsoleApplication2 {     class Program     {         static void Main(string[] args)         {             var client = new SmtpClient("smtp.gmail.com", 587)             {                 Credentials = new NetworkCredential("myusername@gmail.com", "mypwd"),                 EnableSsl = true             };             client.Send("myusername@gmail.com", "myusername@gmail.com", "test", "testbody");             Console.WriteLine("Sent");             Console.ReadLine();         }     } } 

    I also got it working using a combination of web.config, http://msdn.microsoft.com/en-us/library/w355a94k.aspx and code (because there is no matching EnableSsl in the configuration file 🙁 ).

    2021 Update

    By default you will also need to enable access for "less secure apps" in your gmail settings page: google.com/settings/security/lesssecureapps. This is necessary if you are getting the exception "`The server response was: 5.5.1 Authentication Required. – thanks to @Ravendarksky

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason neither SQL managment studio nor import and export wizard works on
For some reason when I attempt to make a request to an Ajax.net web
My starting problem is this error message: Problem accessing /segment.htm. Reason: Neither BindingResult nor
For some reason I started VS 2008 this morning and I wont display any
I have noticed that for some reason my objects that are neither coming from
For some reason I can't seem to get the basic example to work, provided
For some reason I never see this done. Is there a reason why not?
For some reason when I create a new namespace in Visual Studio 2008 its
For some reason, when I try to install SQL Server 2008 Express , I
For some reason, lately the *.UDL files on many of my client systems are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.