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)
 Sending SMTP Mail using a Stored Procedure

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-11-13 : 08:03:13
tony writes "I had recently read this article (http://www.sqlteam.com/item.asp?ItemID=5003) which stated that this Stored Procedure could easily be modified to use JMAIL. I tried to modify it for Jmail, but I don't get any emails. Am I doing something wrong with my code? I wanted to ask you guys first before I start messing around with the JMAIL component. Below is a snippit of what I've done:

@MailServer varchar(100) = 'mymailserver.XX.edu'
EXEC @resultcode = sp_OACreate 'JMail.SMTPMail', @oMail OUT
..
EXEC @resultcode = sp_OASetProperty @oMail, 'ServerAddress',@mailserver
EXEC @resultcode = sp_OASetProperty @oMail, 'Sender', @SenderAddress
EXEC @resultcode = sp_OAMethod @oMail, 'AddRecipient', NULL, @RecipientName, @RecipientAddress
EXEC @resultcode = sp_OASetProperty @oMail, 'Subject', @Subject
EXEC @resultcode = sp_OASetProperty @oMail, 'Body', @Body
EXEC @resultcode = sp_OAMethod @oMail, 'mail()', NULL

thanks!
-tony"

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2003-11-13 : 08:11:29
Have you checked your SMTP server logs ? Chances are good that the messages got there and stopped.


Damian
Go to Top of Page
   

- Advertisement -