Here is the page http://www.trailsticker.com/contact.aspx
It sends and/or errors out fine in FF but doesn't seem to work in IE. Any suggestions?
The code behind
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net.Mail;
using System.Drawing;
using System.Configuration;
using System.Web.Configuration;
using System.Net.Configuration;
public partial class contact : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void sentButton_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
try
{
string output = "";
MailMessage mail = new MailMessage();
string hostAddress = "mail.trailsticker.com";
string message = messageTextBox.Text.ToString();
message = message.Replace(Environment.NewLine, "<br />");
string fromEmail = emailTextBox.Text.ToString();
string subject = subjectDropDown.Text.ToString();
output = "<p>Name: " + nameTextBox.Text.ToString() + ".</p>";
output += "<p>E-mail: " + emailTextBox.Text.ToString() + ".</p>";
output += "<p>Subject: " + subjectDropDown.Text.ToString() + ".</p>";
output += "<p>Message: " + message + ".</p>";
mail.Subject = subject;
mail.From = new MailAddress(fromEmail);
mail.To.Add("xxxxxx@trailsticker.com");
mail.Body = message;
mail.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient(hostAddress);
smtp.Send(mail);
Response.Redirect("http://www.trailsticker.com/sent.aspx");
}
catch (Exception err)
{
notificatoinLabel.Text = "E-mail wasn't sent. There was an exception: " + err.ToString() + ".";
}
}
}
}
|