Sometimes I need to run something on my website. For instance, right now I want to send a mail out from the support account to someone.
To do this, I plan to create a temp webpage, then put some code in the page_load event, then delete the webpage:
protected void Page_Load(object sender, EventArgs e)
{
String notificationMessage = "Email body.";
Mailer.SendMail("[email protected]", "Email header", notificationMessage);
}
This is a bit silly. However, it is fairly convinient for accessing stuff I've set in web.config, like sql servers and mailing modules.
Is there a better way to do this?