C
chumley
I am taking some stuff from an html form and posting it to a .net mail
component, have weeded out a few token syntax errors, it now looks
like it sends, but i don't see the message in my mailbox.
(e-mail address removed) is a valid email address on the domain i'm using.
Wondering if i'm doing something wrongs in regards to the EventArgs ,
as this file is called post-test.aspx, as that's how i've set the form
action on the previous page :
<%@ Page Language="C#" Debug="true" %>
<%@ Import NameSpace="System.Web.Mail" %>
<script runat="server">
protected void Send_Email(Object Sender, EventArgs e) {
const string SERVER = "relay-hosting.mywebhostsucks.net";
MailMessage Mail = new System.Web.Mail.MailMessage();
Mail.To = "(e-mail address removed)";
Mail.From = "(e-mail address removed)";
Mail.BodyFormat = MailFormat.Text;
Mail.Subject = "Order.net testing";
Mail.Body = Request.Form["email"] + "<br>" + Request.Form
["ordertotal"];
SmtpMail.SmtpServer = SERVER;
SmtpMail.Send(Mail);
Mail = null; // free up resources
Response.Flush();
}
</script>
component, have weeded out a few token syntax errors, it now looks
like it sends, but i don't see the message in my mailbox.
(e-mail address removed) is a valid email address on the domain i'm using.
Wondering if i'm doing something wrongs in regards to the EventArgs ,
as this file is called post-test.aspx, as that's how i've set the form
action on the previous page :
<%@ Page Language="C#" Debug="true" %>
<%@ Import NameSpace="System.Web.Mail" %>
<script runat="server">
protected void Send_Email(Object Sender, EventArgs e) {
const string SERVER = "relay-hosting.mywebhostsucks.net";
MailMessage Mail = new System.Web.Mail.MailMessage();
Mail.To = "(e-mail address removed)";
Mail.From = "(e-mail address removed)";
Mail.BodyFormat = MailFormat.Text;
Mail.Subject = "Order.net testing";
Mail.Body = Request.Form["email"] + "<br>" + Request.Form
["ordertotal"];
SmtpMail.SmtpServer = SERVER;
SmtpMail.Send(Mail);
Mail = null; // free up resources
Response.Flush();
}
</script>