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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:22:30+00:00 2026-05-22T23:22:30+00:00

i am using mail class to send email with attachment as image to multiple

  • 0

i am using mail class to send email with attachment as image to multiple recipients.
but the problem is as email is sent to first recipient it is throwing an exception that “image is being used by another process”.. how this can be solved..

i am getting users in listitem as:

 foreach (ListItem item in lstboxlist.Items)
                {
                    to = Convert.ToString(item);
                    select_theme_tosend(to, sub);
                }

and i am sending mail to users as:

string source_theme =  theme;
            string dest_theme_path = "xxx";

            if (File.Exists(dest_theme_path))
            {
                File.Delete(dest_theme_path);
            }
            File.Copy(source_theme, dest_theme_path);
            xmlDoc.Load(theme);
            XmlNode node = null;
            SendMail_Html send_html = new SendMail_Html ();

                MailMessage mail = new MailMessage();
                Attachment footer_att = null;
                Attachment header_att = null;
                Attachment other_att = null;
                mail.Attachments.Add(other_att);
                }
                xmlDoc.Save(theme);

                StreamReader strm_rdr = new StreamReader(theme);
                string theme_text = strm_rdr.ReadToEnd();

                SendMail send_mail = new SendMail();
                send_html.sent_htmlmail1(to, theme_text, subject, footer_att, header_att, other_att);
                mail.Dispose();
               // File.Delete(header_path);
               // File.Delete(other_imagepath);
               // File.Delete(foot_image_path);  
}  

if i uncomment last line it is showing an error on sending mail to second address as:
“specified file cannot found”…
what should i do to send multiple emails…
please help…

  • 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-22T23:22:30+00:00Added an answer on May 22, 2026 at 11:22 pm

    Close the stream after you’ve finished with it, so for example:

    StreamReader strm_rdr = new StreamReader(theme);
    string theme_text = strm_rdr.ReadToEnd();
    strm_rdr.Close();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using mail message class to send an email. But if i check
Am trying to asynchronously send an email with an attachment using .net's SMPTClient class:
I wish to send an email from my localhost machine (using PHPs mail function)
I am using Zend_Mail to send an email of a log file, but it
I have been struggling with trying to send an email with an attachment using
I'm using PHP to send an attachment in an email, all works as expected
I'm trying to attach a PDF attachment to an email being sent with System.Net.Mail.
How can I send an email using SYstem.Net.Mail to an email address that is
I'm trying to send an email message using the .NET MailMessage class which can
I am trying to send email using the following method in my action class:

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.