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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:49:09+00:00 2026-05-26T22:49:09+00:00

I have a process that uses EWS Managed API to save email messages as

  • 0

I have a process that uses EWS Managed API to save email messages as eml files. Like this:

var propertySet = new PropertySet(BasePropertySet.FirstClassProperties, ItemSchema.MimeContent, EmailMessageSchema.IsRead);
message.Load(propertySet);
File.WriteAllBytes(fullPath, message.MimeContent.Content);

After the file is saved, I add a record to the database. The problem is, when the application is done saving the eml for particularly large emails, I cannot connect to SQL Server. I get “Login failed. The login is from an untrusted domain and cannot be used with Windows authentication” when this code gets to here:

using (SqlConnection conn = new SqlConnection(connString))
{
     conn.Open();

None of the other posts with this error message seem to fit my situation. I can connect to SQL Server with no problems until I run across a large email message.

  • 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-26T22:49:09+00:00Added an answer on May 26, 2026 at 10:49 pm

    Why not just keep your connection to SQL open while your process is running? Do you need to re-establish it for every message? If so – you will quickly run out of available ports or reach a user limit depending on how SQL Server is configured and your licensing model. You should do a netstat and check how the connections grow. Eventually these connections will be freed, but it is something to consider.

    Are you using single or multi-threaded application model when interfacing and processing the EML files?

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

Sidebar

Related Questions

I have a website that uses seperate files to process the PHP like the
I have a process that uses a lot of memory mapped files. Problem is
I have an IronPython script that uses the TPL and Parallel.ForEach to process files
I have a process that uses an XmlReader. I have already done a lot
I have a script that uses Parallel::ForkManager . However, the wait_all_children() process takes incredibly
I have a basic authentication process that uses Zend_Auth_Adapter_DbTable . I have login and
I have a button that uses Process.Start to initiate a process along with a
I have a process that uses a library to do a time and memory
I have an automated batch process that uses sqlcmd to pull data from a
I have a django project that uses a worker process that sends emails to

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.