Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 To send email from sql server

Author  Topic 

sonia123
Starting Member

7 Posts

Posted - 2005-05-24 : 01:00:17
sir/madam,
how to send email from the sql server to the customer. i have used sp_sendmail but it shows me error in loading DLL.
can anyone help me in solving this problem?
thank you

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2005-05-24 : 01:10:41
Are you using this ? http://www.sqlteam.com/item.asp?ItemID=5003

Did you install the dll ?


Damian
Ita erat quando hic adveni.
Go to Top of Page

sonia123
Starting Member

7 Posts

Posted - 2005-05-24 : 03:14:00
no we r not using this http://www.sqlteam.com/item.asp?ItemID=5003
is it necessary to use this component?

how to check whether dll is installed?

thanks for reply


Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2005-05-24 : 03:23:17
You have to give us some more information then.
What dll are you trying to load ? What is the error ?
What have you done to configure your server to send mail ?
Are you sure you are using sp_Sendmail ? Or maybe xp_Sendmail ?



Damian
Ita erat quando hic adveni.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-05-24 : 03:39:44
CREATE PROCEDURE SendMail(
@From varchar(255),
@To varchar(255),
@Message varchar(8000),
@Subject varchar(255))
AS

DECLARE @CDO int, @OLEResult int, @Out int

--Create CDONTS.NewMail object
EXECUTE @OLEResult = sp_OACreate 'CDONTS.NewMail', @CDO OUT
IF @OLEResult <> 0 PRINT 'CDONTS.NewMail'


EXECUTE @OLEResult = sp_OASetProperty @CDO, 'BodyFormat', 0
EXECUTE @OLEResult = sp_OASetProperty @CDO, 'MailFormat', 0

--Call Send method of the object
execute @OLEResult = sp_OAMethod @CDO, 'Send', Null, @From, @To, @Subject, @Message, 1 --0 is low 1 is normal
IF @OLEResult <> 0 PRINT 'Send'

--Destroy CDO
EXECUTE @OLEResult = sp_OADestroy @CDO

return @OLEResult

GO


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -