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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:06:30+00:00 2026-05-25T12:06:30+00:00

Here’s the code I’m running: try { var fromAddress = new MailAddress(foo@ree.com, foo); var

  • 0

Here’s the code I’m running:

try
{
    var fromAddress = new MailAddress("foo@ree.com", "foo");
    var toAddress = new MailAddress("test@gmail.com", String.Empty);
    const string fromPassword = "password";
    const string subject = "Welcome!";
    const string body = "This is a test message!";

    var smtp = new SmtpClient
    {
        Host = "mail.foo.com",
        Port = 143,
        EnableSsl = false,
        DeliveryMethod = SmtpDeliveryMethod.Network,
        UseDefaultCredentials = false,
        Credentials = new NetworkCredential(fromAddress.Address, fromPassword)
    };
    using (var message = new MailMessage(fromAddress, toAddress)
                                        {
                                            Subject = subject,
                                            Body = body
                                        })
    {
        smtp.Send(message);
    }
}
catch (Exception e)
{
    Debug.WriteLine(e.InnerException.ToString());
    //Add logging here.
}

When I try to run smtp.Send(message) the following error is fired:

A first chance exception of type 'System.Net.Mail.SmtpException' occurred in System.dll
    System.FormatException: Smtp server returned an invalid response.
    at System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 offset, Int32 read,  Boolean readLine)
    at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine)
    at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller)
    at System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint)
    at System.Net.Mail.SmtpTransport.GetConnection(ServicePoint servicePoint)

What are the probably causes for this error? What should I be looking for?

  • 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-25T12:06:31+00:00Added an answer on May 25, 2026 at 12:06 pm

    Are you sure your SMTP port is 143? Default is 25. It looks like it can’t talk with the server correctly first (since the error is in GetConnection).

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

Sidebar

Related Questions

Here is the code I'm using http://jsbin.com/evike5/edit When the jQuery UI dialog is fired
here are 2 screen shots when i try to debug my code in visual
Here a simple question : What do you think of code which use try
Here my code: $(document).ready(function() { $('#mid_select').live('click', function(e){ $('#middle').load( $(this).attr('href') + ' #middle'); var page
Here is my code, which takes two version identifiers in the form 1, 5,
Here is what I have: Dim cmsManager As New Telerik.Cms.CmsManager() Dim currentNode As Telerik.Cms.Web.CmsSiteMapNode
Here's my scenario. I've got SharePoint 2010 running on one server, with an SQL
here is the site : http://www.notrepanorama.com at the bottom left, i use a jquery
Here's some of my production code (I had to force line breaks): task =
here is a link to how my APC is running : [removed] As you

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.