difference xp_sendmail and sp_send_dbmail proc

sql-server, sqlmail

Solution

`xp_sendmail` requires a MAPI client installed, such as Outlook, on the server. This is the only option for SQL Server 2000 and before.

`sp_send_dbmail` is a simple SMTP solution, added for SQL Server 2005+

`sp_send_dbmail` is by far better.

Problem

Can I ask what is the difference between `xp_sendmail` and `sp_send_dbmail` proc? They are both send e-mail message, which may include a query result set attachment, to the specified recipients..... What is the difference?

Original source