VIPIN.V
VIPIN.V

Reputation: 1

SQL Server sending mail using xp_smtp_sendmail procedure

I have configured my SQL Server 2008 R2 with the following commands and steps.

  1. for the mail configuration, I have downloaded XPSMTP70.ZIP and copy xpsmtp70.dll into C:Program Files\MSSQL\80\Tool\binn

  2. Then I executed exec sp_addextendedproc 'xp_smtp_sendmail', 'xpsmtp70.dll' in the Master database. I also executed grant execute on xp_smtp_sendmail to public in the master database.

But when I run this code to send mail

EXEC master.dbo.xp_smtp_sendmail 
        @TO = '[email protected]', 
        @from = '[email protected]', 
        @message = 'fgsdjfgsd sdfsdgfsdg sdjfdsjgh', 
        @subject = 'foo was fired.', 
        @server = 'smtp.gmail.com' `

I get an error message

Could not load the DLL xpsmtp70.dll, or one of the DLLs it references. Reason: 126 (The specified module could not be found.).

Please help ....

Upvotes: 0

Views: 13032

Answers (1)

marc_s
marc_s

Reputation: 754983

As far as I know, in SQL Server 2005 and up, you are better off not using the old mail stuff based on "SQL Mail" and extended procedures.

Instead, use the built-in Database Mail - see SQL Server 2008 - Configure Database Mail for a step-by-step procedure on how to set it up and use it

Upvotes: 4

Related Questions