Database Mail

Larry Rungren
Larry Rungren used Ask the Experts™
I have some scripts that run every night in SQL Server 2008 that send emails to specific customers using Ipswitch Imail.  These scripts have been running for several years.  We use a product called GroupMail that also utilizes Imail to send bulk emails.

GroupMail works correctly. It resides on the same server as Imail

When sending mail from SQL Server machine using dbmail..... Nothing.  Dbmail when sending a test email says the job was queued but never gets to the server.  The only difference since this stopped working is the Imail server was virtualized, nothing changed just virtualized.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Will SzymkowskiSenior Solution Architect
Most Valuable Expert 2015
Top Expert 2015

Virtualizing a Server will not change any of the settings on the Exchange server. If this was working at one point and it is not now, I would recommend that you take a look at your Receive connector settings as you probably have an anonymous receive connector setup for specific IP's to send mail out. I wonder if this IP got removed or if the Group Permissions got chagned.

Another thing that could have happening is that if this application is using Authenticated to send email, then maybe the account is locked out or disabled or possibly deleted.

Larry RungrenDirector of Technology


The day this stopped working an outside consultant installed a new domain controller and change the domain name from mcle_nt to mcle.local.  No other processes in the company has been effected.
Larry RungrenDirector of Technology


This is really a HUGE, HUGE problem.  I have shut down the virtual system and brought the old server back on line and still nothing is working.  The only thing I can't account for is the new Domain Controller and the change in the domain name.  If anyone has any ideas or could take a minute to call 617-896-1178.  This is causing a huge problem in the day to day operation of our business.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Professional Troublemaker^h^h^h^h^hshooter
I would _assume_ the problem was with DBMail authenticating in the new domain.  (And, if I were at the server, I'd probably want to look at a few tables:
select top 20 * from msdb.dbo.sysmail_allitems order by send_request_date DESC

select top 20 * from msdb.dbo.sysmail_event_log order by log_date DESC

select top 20 * from msdb.dbo.sysmail_unsentitems order by mailitem_id DESC

select top 20 * from msdb.dbo.sysmail_sentitems order by mailitem_id DESC 

Open in new window

Just to confirm whether the emails are leaving the SQL server.

Changing a domain name can be kinda a big deal.  Where the SQL and/or mail servers in the domain that changed?  Did either rely on the old domain controller for services such as DNS name resolution?  (From each server, can you ping the other by name at the command prompt?)

Assuming the problem is with authentication into the new domain, I'd start in
SQL Management Studio, on that server, in Management -- right click "Database Mail", "Configure Database Mail", and when it asks you to Select a Configuration Task, "Manage Database Mail accounts and profiles", "View, change, or delete and existing account"...
... On that page... look over the SMTP Authentication section carefully.  I suspect that may be where you need to put in new credential information.
Larry RungrenDirector of Technology


I see the items as unsent.

1. SMTP server is Ipswitch Imail on server mcleftp01old  Can ping from SQL Server.

2 Ipswitch Imail domain is

3. Imail user is "customerservice2", email account  is ""

4. Password is correct.

5. return email is ""  (Office365 email account)

6. I am using the correct credentials am I not?
Rich WeisslerProfessional Troublemaker^h^h^h^h^hshooter

Okay, if I interpret correctly, the mail isn't leaving the SQL server... so the problem is between the the SQL Server and the first SMTP server.  (I assume Group Mail receives the email after IMail?)

"Ping mcleftp01old" from the SQL box lets us know that (1) name resolution is working, and (2) there exists a path between the systems.  (On the SQL box, I'd normally "Telnet mcleftp01old 25" to confirm that an SMTP server responds.)

Do you have logging enabled on IMail?  Can you see if IMail is receiving a connection attempt from the SQL server and is failing the connection for authentication or some other reason?
Larry RungrenDirector of Technology


Once we had proven the mail wasn't leaving the server, and there was no obvious configuration problem I went to the nuclear option, I deleted all profiles in dbmail, recreated a new profile,  et voila, dbmail is back and running.   Modified the stored procedure to use the new profile and all missing emails have been sent.

Thanks for getting me looking in the right place, it always helps.


Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial