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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:21:33+00:00 2026-05-31T05:21:33+00:00

I had configure smpt mail for my site and it’s work when I tried

  • 0

I had configure smpt mail for my site and it’s work when I tried to send one single email but I have following error when I want to send it to more people, In addition I use SendAsyn method.

When I Send all Emails using LOOP

Syntax error, command unrecognized. The server response was:
at System.Net.Mail.SmtpConnection.ConnectAndHandshakeAsyncResult.End(IAsyncResult result)

at System.Net.Mail.SmtpClient.ConnectCallback(IAsyncResult result)


When I Add All Emails to BCC

Service not available, closing transmission channel.
The server response was: Too many bad commands, closing transmission channel
at System.Net.Mail.SendMailAsyncResult.End(IAsyncResult result)
at System.Net.Mail.SmtpTransport.EndSendMail(IAsyncResult result)
at System.Net.Mail.SmtpClient.SendMailCallback(IAsyncResult result

what is the solution for that ?

  • 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-31T05:21:33+00:00Added an answer on May 31, 2026 at 5:21 am

    I have a similar situation whereby l am sending multiple emails and not waiting for one to finish before sending another.

    What l did was initiate a new SMTPClient for every mail to be sent and send asynchronously. Like this:

            private void SendMailAsync(string ids, MailMessage mail)
        {
            SmtpClient client = null;
    
            try
            {
                client = new SmtpClient(ConfigurationManager.AppSettings["MailServer"], Convert.ToInt32(ConfigurationManager.AppSettings["MailPort"]));
    
                string userState = "MailQueueID_" + ids;
    
                client.SendCompleted += (sender, e) =>
                {
                    // Get the unique identifier for this asynchronous operation
                    String token = (string)e.UserState;
                    DateTime now = DateTime.Now;
                    try
                    {
                        if (e.Cancelled)
                        {
                            LogError(new Exception(token + " - Callback cancelled"));
                            return;
                        }
                        if (e.Error != null)
                        {
                            LogError(e.Error);
                        }
                        else
                        {
                            logWriter.WriteToLog(this.jobSite + " - " + token + " (Email sent)");
                            try
                            {
                                int updated = UpdateMailQueue(token, now);
                                if (updated > 0)
                                {
                                    // Update your log
                                }
                            }
                            catch (SqlException sqlEx)
                            {
                                LogError(sqlEx);
                            }
                        }
                    }
                    catch (ArgumentNullException argument)
                    {
                        LogError(argument);
                    }
                    finally
                    {
                        client.SendCompleted -= client_SendCompleted;
                        client.Dispose();
                        mail.Dispose();
    
                        // Delete the attachment if any, attached to this email
                        DeleteZipFile(token);
    
                        counter--;
    
                    }
                };
                client.SendAsync(mail, userState);
                counter++;
            }
            catch (ArgumentOutOfRangeException argOutOfRange)
            {
                LogError(argOutOfRange);
            }
            catch (ConfigurationErrorsException configErrors)
            {
                LogError(configErrors);
            }
            catch (ArgumentNullException argNull)
            {
                LogError(argNull);
            }
            catch (ObjectDisposedException objDisposed)
            {
                LogError(objDisposed);
            }
            catch (InvalidOperationException invalidOperation)
            {
                LogError(invalidOperation);
            }
            catch (SmtpFailedRecipientsException failedRecipients)
            {
                LogError(failedRecipients);
            }
            catch (SmtpFailedRecipientException failedRecipient)
            {
                LogError(failedRecipient);
            }
            catch (SmtpException smtp)
            {
                LogError(smtp);
            }
        }
    

    The error was caught in the SendCompletedEvent Handler.

    Of course the error appeared for only one email while the other 7 went thru to different mail boxes both before and after it in the same run. What caused the error, l still don’t know.

    When l ran my program again, it picked up the mail that was not sent and sent it off successfully.

    Hope this helps others cos l realise that the question was posted more than 15 months ago.

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

Sidebar

Related Questions

Had to download Command Line Tools from Apple to get make to work, but
Had a good read through similar topics but I can't quite a) find one
Had this working; at one stage. The problem is the following text is now
I had tried to create the library for iphone OS 4, but was getting
I had try http://mail.python.org/pipermail/image-sig/2010-June/006313.html , but I get a error still dreampuf@HX:~/hub/lweibo$ python2.7 lweibo.py
I have had several attempts following the procedure at official video lan wiki using
I have installed android SDK in my computer successful.but when i configure the environment
I had configured the Jadeclipse plugin for viewing .class files, but it is still
Had a good search here but can't see anything that gets my mind in
Had a problem with the recursive conflictCheck() method. That seems fine now. I have

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.