In a recent user group meeting in my city Ahmedabad, I have found that not every user knows the difference between these two features of SQL Server. I do not blame any user for not knowing the difference between Database Mail and SQLMail as this is very confusing sometimes. I will try to explain this concept here.
Database mail is a newly introduced concept in SQL Server 2005 and it is the replacement of SQLMail of SQL Server earlier version. It has many enhancements over SQLMail. Database Mail is based on SMTP (Simple Mail Transfer Protocol) and also very fast and reliable where as SQLMail is based on MAPI (Messaging Application Programming Interface). Mail depends on Service Broker so this service must be enabled for Database Mail. It can be encrypted for additional security. SQLMail is lesser secure as it can encrypt the message as well as anybody can use SMTP to send email. Additionally, for MAPI to be enabled for SQLMail it will require Outlook to be installed. All this leads to potential security threat to database server.
In summary, I suggest if you are using SQLMail, it is the right time to upgrade to Database Mail.
If you still want to use SQLMail you will have to enable it with specific commands.
EXEC sp_configure 'SQL Mail XPs', 1 GO RECONFIGURE GO
Again, I suggest upgrading to Database Mail and start to stop using SQL Mail.
Reference: Pinal Dave (https://blog.sqlauthority.com)
47 Comments. Leave new
one.
‘SQL Mail XPs’ or ‘Database Mail XPs’?
Oh, I see… nevermind my last comment. You were telling them how to turn on the old SQL Mail XPs, not how to turn on the new Database Mail XPs.
Nice and concise. Switching to SMTP makes setting up mail capability on your SQL server a breeze.
Can you please put a blog on how to setup database mail (step by step). I am trying to send response back if a Job fails.
Hi Pinal,
If I want to read emails and process them using database mail, how can I do it. Are you able to help.
Thanks,
good one. is there any condition that db server and smtv server should be on same physical machine?
Dear Pinal
I am using sql server 2005 sp1 but unable to send mail , is there need any aditional software apart from outlook 2003.
Thanks in Advance
Regards
Jayant
Imran, I have seen some of your posts on this blog, U have explained them very clearly and in detail,, like Txn trun
I have a question regarding DB mail, is there a way that i can either attach error log or give a detailed error message to the recipient mail when a job fails.
Please let me know if that works on SQL 2005 DB Mail.
Details: Windows 2003 Enterprise
SQL: SQL Server 2005 Enterprise with latest SP4
Thank you,
Rao
Sorry typo SQL 2005 SP3
Hi,
You have mentioned in your post that “Database Mail can be encrypted for additional security”. I have tried to find some information regarding this feature but wasn’t able to locate anything. Would you have any technical information (how does it work and how to implement it) regarding this functionality?
Thank you for your time.
Regards,
Joseph
Is it possible to send MIME (Multipart email) via Database Mail
Thanks
Nice article,
What ever i find i got every information from this website.
it’s great.
Sending Emails with DB Mail works fine, but DB Mail can’t read emails! So DB is not a full replacement. Does someone has a suggestion how to read emails?
Thanks
I need to read e-mails
how do you do this with SQL 2008 without SQL mail?
Hi Alunjd,
Before you start enabling DB MAIL on SQL 2005/2008, check port 25 is opened on the server to communicate with exchangeserver.
To do this type in cmd
1.) telnet exchangeservername 25
If it gets connected then you can send email.
2.) Configure Database Mail under Management.
3.) Creator an operator to send email to RCPT’s
4.) Under SQL Server agent properties enable mail profile.
5.) If SQL 2005 then enable DBmail under surface area configuration…….
Good to goo
And thanks Imran Mohammed for previous post..
Rao
We have upgraded from SQL2000 to SQL2008 but by switching to Database Mail from SQL Mail we are now unable to send files in CSV format.
Can someone explain how we send CSV output from SQL Server via Database mail?
Thanks
Andy
Hi Pinal,
We have SQL Serve 6.5 and I’m trying to set up SQL Mail.
Can you please provide step by step instructions on how to install it?
Thanks for your help in advance!
Regards,
Joseph
Hi Pinal,
Good article, but what are the pre-requisites or scenarios where we can make use of this. I wanted to know from a layering point of view.
I would prefer to have my mail logic with front-end layer rather than loading up the database. Can you please advise.
Regards,
Shah
Dear Sir,
how do i send mail from sql server 2005/2008 express edition as they both do not have the feature of database and sql mail?
please help…