Torna al Thread
try
{
string addressSender = this.textBox5.Text;
//System.Web.Mail.SmtpMail. SMTPClient = null;
System.Web.Mail.MailMessage message = new System.Web.Mail.MailMessage();
try
{
message.Subject = "Test SMTP Parameter CLASSE WEB MAIL";
message.Body = "Email inviata in automatico. Non rispondere a questa email";
message.From = addressSender;
message.To = this.textBox6.Text;
int p = 25;
Int32.TryParse(this.textBox2.Text, out p);
if (this.checkBox2.Checked)
{
message.Fields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"] = 1;
message.Fields["http://schemas.microsoft.com/cdo/configuration/sendusername"] = this.textBox3.Text;
message.Fields["http://schemas.microsoft.com/cdo/configuration/sendpassword"] = this.textBox4.Text;
}
System.Web.Mail.SmtpMail.SmtpServer = this.textBox1.Text;
System.Web.Mail.SmtpMail.Send(message);
}
catch (Exception ex)
{
this.textBox7.Text = this.textBox7.Text + "\r\n\r\n" + ex.InnerException.Message;
}
}
catch (Exception exx)
{
this.textBox7.Text = this.textBox7.Text + "\r\n\r\n" + exx.InnerException.Message;
}