Posted on 2012-09-21
Last Modified: 2012-09-24

Not difficult, and test with one or 2 emails OK.

When I try to run several batches of email one works, the next one won't,

Same script, same account date selection is different.

Small batches OK

errors .....
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2012-09-13T13:46:30). Exception Message: Cannot send mails to mail server. (Mailbox unavailable. The server response was: 5.1.1 User unknown). )
"The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 2 (2012-09-21T10:56:43). Exception Message: Cannot send mails to mail server. (The operation has timed out.). )"
"The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 2 (2012-09-21T10:56:49). Exception Message: Cannot send mails to mail server. (Failure sending mail.). )"

The IP for the server has no limits on sending mail at the barracuda for either the sending email address or the IP.

Frequently get more than 1 message in  one process?

The last process selected 86 records to process yet only 24 were actually sent?

What configuration are we missing?
Question by:Jeff_Kingston
    LVL 38

    Expert Comment

    by:Jim P.
    This is a one time run:

    exec msdb.dbo.sysmail_configure_sp 'DatabaseMailExeMinimumLifeTime', '1200';
    exec msdb.dbo.sysmail_configure_sp 'AccountRetryAttempts', 3;

    Open in new window

    That changes the configuration on the last part of the mail setup

    This basically starts up the mail services to be ready to go.
    IF NOT EXISTS (SELECT * FROM msdb.sys.service_queues
                   WHERE name = N'ExternalMailQueue' AND is_receive_enabled = 1)
        EXEC @rc = msdb.dbo.sysmail_start_sp

    Open in new window

    And you still may get failures.

    Author Comment

    I will give this a try today, this job runs overnight.

    One say "And you still may get failures."  Is this due to more junk from Redmond or simply the nature of trying to get anything to truly run when the Microsoft brand is associated with it.  It seems every release has more errors, omissions, and total lack of any backwards compatibility, standard utilities are placed in a bingo ball and arbitrarily put all over the place at the whim of some engineer?  Upgrades with this company are simply a nightmare.
    LVL 38

    Accepted Solution

    It's a matter of the the SQL Server agent sometimes getting overwhelmed doing other jobs while trying to mail agents. Your best bet is to do stuff at odd time -- start the job at 12:07. The next one at 12:14, instead of all at once.

    Author Closing Comment

    I could buy that in a massive installation, but we have 40 employees and 30% of them spend their entire day working in Microsoft Office.
      I will accept your solution with the caveat that SQL Server is just not a good database solution, and as much as I dislike Larry Ellison, maybe Oracle should be the way to go.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
    Via a live example, show how to setup several different housekeeping processes for a SQL Server.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now