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.
| 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 |
|
|
sonia123
Starting Member
7 Posts |
|
|
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 ?DamianIta erat quando hic adveni. |
 |
|
|
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 MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|