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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:20:07+00:00 2026-05-23T11:20:07+00:00

Hi I have the following Problem: I’m sending e-mail with attachement with CDO (I

  • 0

Hi I have the following Problem:

I’m sending e-mail with attachement with CDO (I need to do this because system.Net.Mail dont work with implicit SSL on 465 port).
The problem is that attached file after sending remain locked.
How can I Unlock its ?

I’m programming using c#.

Thank you for your answer

Piercarlo

  • 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-23T11:20:07+00:00Added an answer on May 23, 2026 at 11:20 am

    I resolved from myself

    After CDO.Message.Send() need this;

    GC.Collect();
    GC.WaitForPendingFinalizers();
    

    Hope that will be usefull for some other else following completee code

    [SqlFunction()]
    public static SqlString SendFromMittente(SqlString Messaggio, SqlString eMailDestinatario, SqlString From, SqlString SmtpHost, SqlString Utente, SqlString Password, SqlString Oggetto, SqlString Allegati, SqlBoolean SSL, SqlInt32 SmtpPort)
    {
        try
        {
            CDO.Message oMsg = new CDO.Message();
            CDO.IConfiguration iConfg;
            iConfg = oMsg.Configuration;
            ADODB.Fields oFields;
            oFields = iConfg.Fields;
            ADODB.Field oField;
            oField = oFields["http://schemas.microsoft.com/cdo/configuration/sendusing"];
            oField.Value = CDO.CdoSendUsing.cdoSendUsingPort;
            oField = oFields["http://schemas.microsoft.com/cdo/configuration/smtpserver"];
            oField.Value = SmtpHost.Value;
            oField = oFields["http://schemas.microsoft.com/cdo/configuration/smtpusessl"];
            oField.Value = SSL.Value.ToString();
            oField = oFields["http://schemas.microsoft.com/cdo/configuration/smtpserverport"];
            oField.Value = SmtpPort.Value.ToString();
            oField = oFields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"];//Use 0 for anonymous 1 for authenticate
            oField.Value = CDO.CdoProtocolsAuthentication.cdoBasic;
            oField = oFields["http://schemas.microsoft.com/cdo/configuration/sendusername"];
            oField.Value = Utente.Value;
            oField = oFields["http://schemas.microsoft.com/cdo/configuration/sendpassword"];
            oField.Value = Password.Value;
            oFields.Update();
            oMsg.Subject = Oggetto.Value;
            oMsg.From = From.Value;
            oMsg.To = eMailDestinatario.Value;
            oMsg.TextBody = Messaggio.Value;
            if (!string.IsNullOrEmpty(Allegati.Value))
            {
                char[] sep = { ',' };
                string[] aryAllegati = Allegati.Value.Split(sep);
                foreach (string file in aryAllegati)
                {
                    oMsg.AddAttachment(file);
    
                }
            }
            oMsg.Send();
            GC.Collect();
            GC.WaitForPendingFinalizers();
            Marshal.FinalReleaseComObject(oMsg);
            return new SqlString("true");
        }
        catch (Exception ex)
        {
            return new SqlString(ex.ToString());
        }
    }
    

    Note that code is write for SQL assembly

    Piercarlo

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

Sidebar

Related Questions

I have the following problem: We need to find the next august. I other
We have following problem. Developers frequently need to make small changes to our web
I have following problem. I want to create a file system based session storage
i have following problem: i look for a variable to work with that comes
I have following problem. I have a team page like this example: http://www.social-markets.de/social-commerce-team.html small
I have following problem. I use this tutorial to creating a multiple file uploader:
I have following problem Bundle bundle = new Bundle(); bundle.putString(url, someUrl); This works fine.
Have the following problem example . The problem is that because of the border
I have the following problem: I have overridden popViewControllerAnimated:(BOOL)animated of UINavigationController because I would
I have following problem: I need to create an NSMutabeArray with every weekday after

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.