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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:55:10+00:00 2026-05-21T09:55:10+00:00

I’m working against a GoogleApps account for sending event notifications from my (mvc) web-app.

  • 0

I’m working against a GoogleApps account for sending event notifications from my (mvc) web-app. Usually everything works fine. When the system is asked to send more than 75 messages or so I’m seeing replies from the SMTP server:

Service not available, closing
transmission channel. The server
response was: 4.7.0 Try again later,
closing connection. (MAIL)
uf10sm1153163icb.17

However, the system is auto-retrying and anything my system is asked to send eventually (by everything i can tell as this point) making it out. But given how the code generates and sends the emails I don’t understand how these re-tries are handled.

I’d like to try to slow down the transmission in hopes that whatever’s causing the ‘Service Not Available’ condition will be placated if the submissions occur asynchronously. But from the looks of the code, it already is since i’m using a Try | catch block.

Here’s the relevant bit of my facade code:

foreach (string email in recipientEmails)
{
    try
    {
        EmailGateway.Instance.SendEmail(email, notificationSubject, notificationMessage);
   }
    catch (Exception ex)
    {
        Logger.Instance.LogException(ex);
        Logger.Instance.LogMessage("ERROR! Unsent email is to: " + email );
    }
    Logger.Instance.LogMessage("Sent " + notificationSubject + " to " + email);
}

And here’s the Gateway code (using System.Net.Mail;):

public virtual void SendEmail(string replyToAddress, string toEmailAddress, string subject, string body)
{
    string destinationEmailAddress = toEmailAddress;
    string fromEmailAddress = "my@address.com";
    bool useSSL = "true";

    MailMessage message = new MailMessage(fromEmailAddress, destinationEmailAddress, subject, body);
    message.IsBodyHtml = true;

    SmtpClient smtp = new SmtpClient();
    smtp.EnableSsl = useSSL;

    smtp.Send(message);
}

So i’m catching both successes and fails into my logger table. What I don’t understand is how I can see a log message for both a fail and then a success condition for the same email address. That indicates a ‘retry’ and, while i’m not surprised that the SmtpClient (the native .net assembly) can retry without explicit code asking it to, I don’t see how my facade’s code is being made to log both conditions.

  • 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-21T09:55:10+00:00Added an answer on May 21, 2026 at 9:55 am

    SmtpClient is not retrying to send the email.
    In your facade code as it is, you are always logging a success, whether you are getting an exception or not.
    You should log success in the try block, otherwise you are catching the exception (logging failure), coming out of the catch block and logging success anyway, which is what you are observing.

    foreach (string email in recipientEmails)
    {
        try
        {
            EmailGateway.Instance.SendEmail(email, notificationSubject, notificationMessage);
            Logger.Instance.LogMessage("Sent " + notificationSubject + " to " + email);
    
       }
        catch (Exception ex)
        {
            Logger.Instance.LogException(ex);
            Logger.Instance.LogMessage("ERROR! Unsent email is to: " + email );
        }
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have a text area in my form which accepts all possible characters from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.