Hello,
I need to send email, but I am not asking users to login (I'm using Windows integrated auth.). It seems that ASPRunner only sends email if you set up smtp info in the Security page. "No problem, I'll write my own code" I thought. Here is the code I added to After Record Added:
Set myMail=CreateObject("CDO.Message")
myMail.Subject=dict("Subject")
myMail.From="tech@mndigerati.com"
myMail.To=dict("SendTo")
myMail.Cc=dict("Cc")
myMail.TextBody=dict("Body")
myMail.Send
set myMail=nothing
When I attempt to save the record I get the following error:
EXECUTE permission denied on object 'sp_send_dbmail', database 'msdb', schema 'dbo'.
This confuses me because I wouldn't think the DB server had anything to do with sending the email. Am I worng about that? Also, the record is not added, which also seems odd because the send email code should execute after that.
One last piece of info; I can put my code in a test.asp page on my web server - changing the "dict" variables to hard coded entries - and it is sent without any problems.
Thanks for any help,
Tim