Dronealone
IS-IT--Management
Hi,
I'm new to ASP.NET. I need to send an email from a form which is already built, posting variables to my aspx C# page.
When an ASP.NET page is called, can you not procedurally execute the code on it? The page to which the form is posted is:
<%@ Import Namespace="System.Web.Mail" %>
<script language="c#" runat="server">
MailMessage msg = new MailMessage();
msg.To = "abc@abc.co.uk";
msg.From = "abc@abc.co.uk";
msg.Subject = "Subject";
msg.Body = "Body";
SmtpMail.SmtpServer = "mail.domain.co.uk";
SmtpMail.Send(msg);
</script>
When this page is loaded I get errors (on a shared server so don't know what these are!!! web.config needs to be changed).
Can somebody also tell me how I will access the posted form variables and get these into my email?
Thank you!
I'm new to ASP.NET. I need to send an email from a form which is already built, posting variables to my aspx C# page.
When an ASP.NET page is called, can you not procedurally execute the code on it? The page to which the form is posted is:
<%@ Import Namespace="System.Web.Mail" %>
<script language="c#" runat="server">
MailMessage msg = new MailMessage();
msg.To = "abc@abc.co.uk";
msg.From = "abc@abc.co.uk";
msg.Subject = "Subject";
msg.Body = "Body";
SmtpMail.SmtpServer = "mail.domain.co.uk";
SmtpMail.Send(msg);
</script>
When this page is loaded I get errors (on a shared server so don't know what these are!!! web.config needs to be changed).
Can somebody also tell me how I will access the posted form variables and get these into my email?
Thank you!