How can I send HTML mail using SQL Mail of SQL Server 2k?
July 30th 2010
I am using SQL Server 2000. I wanted to send MIME type mail through SQL Mail. So I downloaded xpsmtp80.dll and copied to C:\Program Files\Microsoft SQL Server\MSSQL\Binn\DLL. Then I registered it by exec sp_addextendedproc ‘xp_smtp_sendmail’, ‘xpsmtp80.dll’. I granted permission to public by grant execute on xp_smtp_sendmail to public.Now when I am executing this
declare @rc int
exec @rc = master.dbo.xp_smtp_sendmail
@FROM = N’MyEmail@MyDomain.com’,
@TO = N’MyFriend@HisDomain.com’,
@subject = N’My first HTML mail’,
@message = N’
This is some HTML content
‘, @type = N’text/html’
select RC = @rc
go
An error generating stating
ODBC: Msg 0, Level 16, State 1
Cannot load the DLL xpsmtp80.dll, or one of the DLLs it references. Reason: 126(The specified module could not be found.).
(1 row(s) affected)







August 2nd, 2010 at 7:11 pm
You have to register the dll on the server using regsvr32 so that the operating system can find the dll
Helmut
August 5th, 2010 at 10:46 am
SQL mail uses MAPI, which doesn’t support HTML mail. Read this article for tips on how to configure SMTP mail within SQL Server.