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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:37:23+00:00 2026-06-16T05:37:23+00:00

I got an app (C#) that send email using web service of MS Exchange

  • 0

I got an app (C#) that send email using web service of MS Exchange Server 2010 SP2. It works fine before. But, just 2 weeks ago, I got the problem with it. Sometime the code can send an email but sometime it’s not. I got the error message as below (full error message shows at the end).

The request failed. Unable to connect to the remote server

My code is below.

string ewsUrl = "https://xxxx.xxxx.com/ews/Exchange.asmx";
string userName = "xxxx";
string password = "xxxx";
string to = "xxxx@xxxx.com";
string cc = "xxxx@xxxx.com";

ExchangeService service = new ExchangeService();
service.Url = new Uri(ewsUrl);
service.UseDefaultCredentials = true;
service.Credentials = new WebCredentials(userName, password);

EmailMessage message = new EmailMessage(service);
message.Subject = subject;
message.Body = bodyHtml;
message.ToRecipients.Add(to);
message.CcRecipients.Add(cc);

message.SendAndSaveCopy();

I don’t know what went wrong. I believe that the URL is correct and it’s work sometime and don’t another time. I have search on the internet but don’t found any solutions for this. Is this something about server configuration? I have talked to my IT guy but it seems that he got no idea about the web service. Please help me. The full error message is below.

The request failed. Unable to connect to the remote server
    at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ValidateAndEmitRequest(HttpWebRequest& request)
    at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.InternalExecute()
    at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()
    at Microsoft.Exchange.WebServices.Data.ExchangeService.InternalCreateItems(IEnumerable`1 items, FolderId parentFolderId, Nullable`1 messageDisposition, Nullable`1 sendInvitationsMode, ServiceErrorHandling errorHandling)
    at Microsoft.Exchange.WebServices.Data.ExchangeService.CreateItem(Item item, FolderId parentFolderId, Nullable`1 messageDisposition, Nullable`1 sendInvitationsMode)
    at Microsoft.Exchange.WebServices.Data.Item.InternalCreate(FolderId parentFolderId, Nullable`1 messageDisposition, Nullable`1 sendInvitationsMode)
    at Microsoft.Exchange.WebServices.Data.EmailMessage.InternalSend(FolderId parentFolderId, MessageDisposition messageDisposition)
    at Microsoft.Exchange.WebServices.Data.EmailMessage.Send()
  • 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-06-16T05:37:24+00:00Added an answer on June 16, 2026 at 5:37 am
    ServicePointManager.ServerCertificateValidationCallback = 
        delegate(object sender1,
                 System.Security.Cryptography.X509Certificates.X509Certificate certificate,
                 System.Security.Cryptography.X509Certificates.X509Chain chain,
                 System.Net.Security.SslPolicyErrors sslPolicyErrors) 
        { return true; };
    

    I think you need to add the above code between message.CcRecipients.Add(cc);
    and message.SendAndSaveCopy();

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

Sidebar

Related Questions

I've got an app that lets users send sms messages. Works great when the
I've got a web app that sends a request to a WCF service. The
i've got an android app and a really simple web service that make an
I've got an app that I'd like to send to beta testers using TestFlight.
I've got an iPhone App that is supposed to send POST data to my
I'm trying to write a basic console app that will send an email. The
I've got a Rails 3.2 app that will need to send various transactional &
Say you've got an app that can send out POST requests every time an
I've got a WPF app that's using INotifyPropertyChanged to signal property updates. What I
I am developing an Android App that gets some data from a web server,

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.