I'm trying to send an email from InfoPath after my code has run updating the tables I have on the back end. I got this to work with SMTP but in order for that to work my form would need to be set to Full Trust. So I started trying to work with ADO Query and call a stored procedure to do this. Problem is when I call the stored procedure I don't get an error message but it doesn't seem to reach the Server since I don't see my emails in the logs. Below is the code I'm trying to use. I setup a basic data connection to my server and I try to adjust it to get my email out. Does an yone have any thoughts? Maybe there's another way to call a stored procedure without needing Full Trust?
//Not submitting, emails are not being delivered
AdoQueryConnection connEmail =
(AdoQueryConnection)DataConnections["QV_SendEmail"];
connEmail.Command = "EXEC msdb.dbo.sp_send_dbmail " +
" @recipients = 'Me@Somewhere.com', " +
" @body = 'User has submitted an access request from InfoPath" + Last_Name + "', " +
" @subject = 'Access Request has been submitted via InfoPath' ; ";
connEmail.Execute();