이것은 버튼 클릭 이벤트에서 다음 코드를 실행하는 매우 간단한 문의 양식입니다. 문제는 네트워크 내부에서이 기능이 완벽하게 작동한다는 것입니다.하지만 외부에서 시도 할 때 아무 일도 일어나지 않지만 500 서버 오류가 발생합니다. 특히 이상한 점은 며칠 전 이것이 정상적으로 작동하고 있다는 것입니다. 나는 이것이 아마도 DNS에서 일어나는 일이라고 추측하고 있습니다. 제 질문은, 어떻게 이런 일이 일어나지 않게하고이 형태를보다 안정하게 만들 수 있느냐는 것입니다.asp.net 문의 양식이 갑자기 외부에서 작업을 중단했습니다
string toAddress = "[email protected]";
string fromAddress = "[email protected]";
string mailServer = "mail.mydomain.com";
DateTime now = DateTime.Now;
MailMessage myMailMessage = new MailMessage();
myMailMessage.To.Add(toAddress);
myMailMessage.From = new MailAddress(fromAddress);
myMailMessage.Subject = "Contact Form Submission";
myMailMessage.Body =
"some text" + "\r\n" +
"-------------------------------------------" +
"\r\n" +
"xxx#: " + xxx.Text.ToString() +
"\r\n" + "FirstName: " + FirstName.Text.ToString() +
"\r\n" + "LastName: " + LastName.Text.ToString() +
"\r\n" + "City: " + City.Text.ToString() +
"\r\n" + "ListPrice: " + ListPrice.Text.ToString() +
"\r\n" + "Features: " + Features.Text.ToString() +
"\r\n"
SmtpClient mySmtpClient = new SmtpClient(mailServer);
mySmtpClient.Send(myMailMessage);
Response.Redirect("thankyou.aspx");
나는 항상 이벤트 뷰어를 잊어 버렸다. 필요한 것은 localhost를 사용하는 것입니다. 그러나 이전에 작동했음을 알고 있기 때문에 왜 다른 방식으로 작동을 멈췄는지 잘 모르겠습니다. – mtnwk