You would use C# code, because sending the email is a back-end process.
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();
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);
What do you want to do differently?
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?
I assume you are submitting a form when the save button is clicked? If so, just reference that form field which is passed via POST method. If the name attribute of the field containing the email address was “emailaddress”, then you would access that field’s value like:
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!
What do you think you should do, since Request.Form(“emailaddress”) should contain the email address? Also, be sure to perform some kind of validation on the front-end and on the server side to make sure it is a valid email syntax, plus you should write code to handle any errors which could arise in the sending process. See this page for examples.
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!