Send emails to selected users based on Form input

I am using ASPRunner.NET Version 9.8. I am trying to setup both my Add and Edit page to send emails to users that are selected to receive additions and updates. For example, we have a ticketing system that users add tickets to and on the Add page, they can select who needs to know about this ticket. The field lists the persons name, but when the record is added it actually saves the user’s email address. I would like the user to get an email with the ticket info after the record is saved. How would I do this in ASPRunner.NET? I am guessing it would either be JavaScript or C# code. I would prefer to use code rather than a button since the user will already have to hit one button to save. Thanks!

Thanks for responding! Would you happen to have any sample code that you could share with me? I have this code that was built-in by the tool, but is different than what I want to use. Is there anyway it can be changed slightly?

var rs = GlobalVars.dal.Table(“UsersTableName”).QueryAll();

XVar data;

var rmail = XVar.Array();

while (data = CommonFunctions.db_fetch_array(rs))

{

rmail[“to”] = data[“EmailAddress”];

rmail[“body”] = “Check what’s hot this season”;

rmail[“subject”] = “Monthly newsletter”;

var ret = MVCFunctions.runner_mail(rmail);

if(!ret[“mailed”])

MVCFunctions.Echo(ret[“message”]);

}

I am using a field on the Form to store the email addresses not a table. I was hoping that the field that I am using would be referenced rather than a table. It would be stored on the page during the save process when the record is added to the database. Does that make sense?

Would I replace the “to” line in the code above with what you wrote? Or would I replace the first line or code with what you wrote? By the way, thanks for the quick responses!

First off, thanks again for the information! I just tried to build the code after adding it and the build did not succeed and I got an error message which I have added below. Apparently, the rapid application development tool that I am using doesn’t like Request. I am going to see what built in code would work better for my project.

include\caldaily_TableEvents.cs(453,16): error CS0103: The name ‘Request’ does not exist in the current context [U:\ASPRunnerNETProjects\Version 9.8 projects\ChangeControlCalendarNEW\output\ChangeControlCalendarNEWEventsCS.csproj]

I think I might have figured it out, but need my Network team to lighten our security settings a little. I used values[EmailAddress].ToString() and it compiled. I am just getting a transmit error which is not related to ASP. Thanks again!