Return code from SendMail sp_OAMethod
Posted on 2003-03-24
I have a stored procedure that sends an email using an SMTP Mailer COM Component, ASPmail. It works fine but I want to know if there is a way to retreive the return code if the RecipientAddress is not valid. Here's a portion of the SP that sends the email:
ALTER Procedure PDM_sp_SMTPMail
EXEC @resultcode = sp_OAMethod @oMail, 'SendMail', NULL
if @resultcode <> 0
I figured I could get the return code this way but it seems it's always equal to zero no matter what the Recipient email address is.
Any suggestions will be most appreciated.