I finished Part I with how to send a test message. Right click on Database Mail and select Send a Test Email.
There's an alternative if you want - use the sp_send_dbmail stored procedure. There's no great benefit in using this at the moment, but just for completeness:
Still nothing? You may have a problem.
Check the Logs
Is it unsent? This may mean that something is wrongly configured.
Before looking at the multitude of things it might be, there may be a legitimate reason for your server not being able to send email, even if it is correctly configured.
Can you pass the Buck?
- Check the exclusion list of your anti-virus software - if AV is active on your server, make sure that databasemail.exe is allowed to send messages.
- Is the server behind a firewall? If it is, you can send mail until you are blue in the face, they won't get through.
Next thing to check: can you TELNET to your smtp server on port 25 to make sure nothing is blocked?
Open a DOS Prompt on your server and type telnet mail.domain.ext 25
It should return something like: 220 smtp esmtp Relay
Which means that Telnet is working - 220 is the greeting code.
In my case I was able to get a colleague from the network services team to send an email from that box using his email diagnostics tool - that worked fine, so narrowing it down to a SQL Server issue,
Here's a reference to Microsoft's article Troubleshooting Database Mail: General steps - the version for 2008r2 - Database Mail doesn't look much different in the other versions, but if you go to that link it'll take you to the other versions.
Make sure that the login SA is the owner of all the system databases, and especially msdb.
Things to Check
It's probably a good idea if a named individual is not the owner of the user databases - things might go awry when that person leaves. But for the moment, we are just checking the system DBs.
Or as so often in SQL Server, there's another way to do it:
Are you a member of the sysadmin fixed server role or msdb db_owner role? This is a fairly safe bet if you are a DBA.
Otherwise, you should be a member of the DatabaseMailUserRole.
A good reason for doing this is that eventually you are going to fix this issue, and when you do, a hundred and one test messages are going to suddenly appear in your inbox.