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 4079414
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:47:56+00:00 2026-05-20T17:47:56+00:00

Possible Duplicate: Sending email through Gmail SMTP server with C# I would like my

  • 0

Possible Duplicate:
Sending email through Gmail SMTP server with C#

I would like my ASP.NET MVC application to send some standard letters to users of the web site. For testing purposes I have no local SMTP server and my provider has non that I know of. So I have to use public services like GMail’s SMTP.

How do I send e-mail using smtp.gmail.com and my GMail account? What exactly should I put to Web.config and whot to code provided my e-mail is drastomail@gmail.com and my password is password?

Thank you


EDIT

When I try following demo program:

class Program {
    static void Main(string[] args) {
        var client = new SmtpClient("smtp.gmail.com", 587) {
            Credentials = new NetworkCredential("puzzlehunters@gmail.com", "puzzlehunters111"),
            EnableSsl = true
        };
        client.Send("puzzlehunters@gmail.com", "puzzlehunters@gmail.com", "test", "testbody");
        Console.WriteLine("Sent");
        Console.ReadLine();
    }
}

It fails with exception. Most inner exception carries this message:

No connection could be made because the target machine actively refused it 209.85.227.109:587

Also any all present answers (3 earliest) give me the same exception. What can I do with that?

  • 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-20T17:47:57+00:00Added an answer on May 20, 2026 at 5:47 pm

    This could be a firewall issue. The firewall on the server your code is running on could be blocking traffic on TCP port 587. It is also possible that it is being blocked in the network infrastructure between your server and the Internet.

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

Sidebar

Related Questions

Possible Duplicate: Sending Email in .NET Through Gmail I have so many problems with
Possible Duplicate: How do you send email from a Java app using Gmail? How
Possible Duplicates: ASP.NET- Sending an e-mail how to send mail using C#? How can
Possible Duplicate: Sending SMS from PHP I would like to make and develop a
Possible Duplicate: Receive and send emails in python I've been looking into sending mail
Possible Duplicate: .NET - What’s the best way to implement a catch all exceptions
Possible Duplicate: PHPMailer AddAddress() Here is my code. require('class.phpmailer.php'); $mail = new PHPMailer(); $email
Possible Duplicate: HTTP vs HTTPS performance When sending larger files (e.g. 10-15 MB) over
Possible Duplicate: Lock the Android device programmatically I want to lock the screen through
Possible Duplicate: Can we change the device time using an application? is that possible

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.