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

  • SEARCH
  • Home
  • 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 6192027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:52:24+00:00 2026-05-24T02:52:24+00:00

I am trying to email people using gmail. I am not certain why this

  • 0

I am trying to email people using gmail. I am not certain why this is not working correctly. Below is the screenshot of the error thrown.

Exception when emailing

Below here is the code for setting up my mail client.

string body = File.ReadAllText(@"C:\Data\MailTemplates\welcome.html");
        MailMessage message = new MailMessage();
        SmtpClient client = new SmtpClient("smtp.gmail.com");

        client.Port = 587;
        client.Credentials = new System.Net.NetworkCredential("sean.shydow", "password");
        client.EnableSsl = true;
        message.From = new MailAddress("sean.shydow@gmail.com");
        message.IsBodyHtml = true;
        ServicePointManager.ServerCertificateValidationCallback = delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
            { return true; };
        message.To.Add("sean@gmail.com");
        message.Subject = subject.Text;
        message.SubjectEncoding = System.Text.Encoding.Unicode;
        message.Body = body;
        message.BodyEncoding = System.Text.Encoding.Unicode;
  • 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. Editorial Team
    Editorial Team
    2026-05-24T02:52:24+00:00Added an answer on May 24, 2026 at 2:52 am

    Port 587 is for TLS. As you’re using SSL, try port 465 (see http://mail.google.com/support/bin/answer.py?answer=13287 for more).

    Also confirm that your machine can actually connect to the Gmail SMTP ports. Some ISPs block them to avoid botted machines becoming spam factories. Try telnet smtp.google.com PORT for PORTs 25, 465, and 587,. If you get a timeout, then you’re likely firewalled from connecting to these ports outside a certain IP range.

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

Sidebar

Related Questions

I'm trying to generate email from my code that will read correctly for people
I am trying to send email using Exchange 2007 from a console app using
I am trying to send email using smtp authentication through google but I am
I am trying to send an email using the following very standard code. However,
We're currently using Salesforce for our sales process, which involve trying to get people
I'm trying to send out a Plain/HTML multipart email out and I'm currently using
I'm trying to collect emails from a group of people using the following: def
I'm trying to set it up so people can email from within my application.
I'm trying to redirect people to a PDF after they've submitted the form correctly,
I'm trying to find people via Twitter API. I use urls like this: https://api.twitter.com/1/users/search.json?q=some@email.com

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.