動作していない aspx ページにクイック コンタクト フォームがあります。例外が発生した場合に try/catch ブロックを使用していますが、これまでは catch だけが動作していました。メール メッセージ クラスを使用しているコードを教えてください。 System.Net.Mail 名前空間の.Her のコード
try
{
MailMessage EmailMsg = new MailMessage();
EmailMsg.From = new MailAddress(txtEmail.Text,txtName.Text);
EmailMsg.To.Add(new MailAddress("mail address"));
EmailMsg.Subject = "WebAssist Email form";
EmailMsg.Body = "<html><body>This is a text<hr>Test test</body></html>";
EmailMsg.IsBodyHtml = true;
EmailMsg.Priority = MailPriority.Normal;
SmtpClient MailClient = new SmtpClient("");
MailClient.EnableSsl = true;
MailClient.Credentials = new System.Net.NetworkCredential("","");
MailClient.Send(EmailMsg);
Label1.Visible = true;
Label1.Text = "Email sent";
}
catch
{
Label1.Visible = true;
Label1.Text = "Your email was not sent";
}
smtpコンストラクター、ネットワーク認証情報に何を書くべきか教えてくださいよろしくお願いします