In recent user group meeting in my city Ahmedabad, I have found that not every user knows difference between these two features of SQL Server. I do not blame any user for not knowing difference between Database Mail and SQLMail as this is very confusing sometime. I will try to explain this concept here.
Database mail is newly introduced concept in SQL Server 2005 and it is replacement of SQLMail of SQL Server earlier version. Database Mail has many enhancement 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). Database mail depends on Service Broker so this service must be enabled for Database Mail. Database Mail can be encrypted for additional security. SQLMail is lesser secure as it can encrypt the message as well 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 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 upgrade to Database Mail and start to stop using SQLMail.
Reference : Pinal Dave (http://blog.SQLAuthority.com)




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.
[...] for SQL Server. It is used for sending emails and through Database Mails. You can read about SQL SERVER – Difference Between Database Mail and SQLMail here. Service Broker is feature which provides facility to SQL Server to send an asynchronous, [...]
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
@Jayant,
Try : http://blog.sqlauthority.com/2008/08/23/sql-server-2008-configure-database-mail-send-email-from-sql-database/
Regards,
Pinal
@jayant das
If you are using SQL Server 2005, then you have two ways of sending email through SQL Server.
1. Database Mail. (Only SMTP)
2. SQL Mail (Same as SQL Server 2000)
Database Mail does not require any other software, SQL Server itself can send emails given SMTP Server details provded to SQL Server.
If you use SQL Mail, you need to use Outlook. Which I don;t suggest for security reasons and alot of other pain giving reasons
Database Mail is NOT available in SQL Server Express Edition though.
Go through a step by step procedure (screen shots explanation)
http://blog.sqlauthority.com/2008/08/23/sql-server-2008-configure-database-mail-send-email-from-sql-database/
~ IM
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
@Rao.
Thanks for appreciation.
When you create a job, in response tab you can send alert when Job completes/ succeeds/ fail.
Usually when a job succeeds or fails you will get a message related to that job in the same alert.
You can use database mail to send alerts.
Look at link below, to know more how. For SQL Server 2005, process is exact same as shown in below link,
Link : http://blog.sqlauthority.com/2008/08/23/sql-server-2008-configure-database-mail-send-email-from-sql-database/
Another workaround if above procedure does not fulfill your needs, then you can create a logfile for job on operating system ( Right Click Job Name, Click Properties, Double Click Step or edit step, click on Advance tab and select an option that suits best) , the next step (set it in a way, if previous step fails, still this step has to be executed) of the same job will be to send that log file created on operating system through an email ( using xp_sendemail). This will also database mail to send email.
let me know if you have questions.
~ IM.
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