Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We are considering upgrading our SQL Server, which is currently running 2005. We use SQLMail heavily in the organization, both to send e-mails and to import some into a database.

I've read on various places that SQLMail was deprecated and superseded by "Database Mail".

I'm confused because this MS page: http://msdn.microsoft.com/en-us/library/bb402904.aspx seems to imply that it would still work?

I understand the dangers of SQLMail but we do not have the resources to rewrite the scripts right now and would prefer to do it later on.

Does SQLMail still work in 2012, and if not, how easy is it to replace with Database Mail, both for reading and sending e-mails?

share|improve this question

3 Answers 3

up vote 1 down vote accepted

If your use of SQLMail isn't particularly fancy (just running queries and sending to email addresses), you might be able to write a shim procedure that looks like SQLMail to callers but essentially just passes parameters through to Database Mail. I tinkered with something like this a few years back but we wound up biting the bullet and actually changing the application code. So, your existing code would be probably untouched, it would call the "SQLMail" code that is newly written, that code calls Database Mail and people should get email. That would let you start to rework the SQLMail->Database Mail code at your leisure.

share|improve this answer
    
That's a good idea: the problem is that we're importing e-mails too and not just. Did not have a chance to check if Database Mail can do that as well and/or how much the SPs differ. –  Kharlos Dominguez Apr 19 '12 at 14:50
1  
I checked my old notes. I implemented a skeletal 'database mail' on sql2000, using the SQL Mail. This is sort of backwards to my earlier suggestion. We would have moved to that, then migrated from 2000->2005. WORSE: The first line of the dbmail BOL page is: "Database Mail is ... for sending e-mail messages...". msdb has a proc 'sp_send_dbmail', but no 'sp_recieve_dbmail'. I fear this is show-stopping for you, you would need a totally different fix. Maybe write the incoming processing in SQLCLR or Powershell and have dbmail do the outgoing? –  darin strait Apr 19 '12 at 15:44

SQL Mail is gone - the stored procedures aren't there any more.

How easy it will be to replace with Database Mail depends critically on how many different places in your code you call xp_sendmail etc.

If the answer is "one", then you can follow the steps here to convert:

http://technet.microsoft.com/en-us/library/ms187891(v=sql.105).aspx

Configuring Database Mail is not, in itself, particularly complex.

share|improve this answer

According to the following link it seems to be still there in version 2012:

http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.mail.sqlmail.aspx

[EDIT] Sorry this doesn't refers to the sqlmail stored procedure but to the object itself

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.