0
이메일을 보내려면 IIS에서 관리되는 SMTP 서버 구성이 있어야합니다. 내 PC IP 배달을 추가했습니다.> 고급 스마트 호스트에서 내 도메인 이름을 mail.elarabygroup.com으로 추가합니다.으로 이메일 보내기 SMTP
그리고이 코드 추가 :
<script runat="server">
protected void SendEmail(object sender, EventArgs e)
{
SmtpClient smtpClient = new SmtpClient();
MailMessage message = new MailMessage();
try
{
// Prepare two email addresses
MailAddress fromAddress = new MailAddress(
"[email protected]", "From Kareem Test");
MailAddress toAddress = new MailAddress(
"[email protected]", "From Kareem Test");
// Prepare the mail message
message.From = fromAddress;
message.To.Add(toAddress);
message.Subject = "Testing!";
message.Body = "This is the body of a sample message";
// Set server details
smtpClient.Host = "localhost";
// Uncomment for SMTP servers that require authentication
//smtpClient.Credentials = new System.Net.NetworkCredential(
// "user", "password");
// Send the email
smtpClient.Send(message);
// Inform the user
statusLabel.Text = "Email sent.";
}
catch (Exception ex)
{
// Display error message
statusLabel.Text = "Coudn't send the message!";
}
}
</script>
을하지만 오류가 발생합니다
사서함을 사용할 수 없습니다. 서버 응답 : 5.7.1 [email protected]에 릴레이 할 수 없습니다.
"e"나는 그것을 놓쳤다. 그러나 그것은 이유가 없었다. 또한 [email protected] 나는 그것을 보내고 reciev 이메일을 통해 그것을 사용한다. – Myworld
나는 VM웨어에서 일한다고 말할 수밖에 없다. – Myworld
[http://meta.stackexchange.com/questions/46035/should-i-remove-tags-that-dont-contribute-to-categorizing- the-question/46037 # 46037) [태그] (http://meta.stackexchange.com/questions/43879/anti-tags-valid-use-or-not) [프로그래밍되지 않는 관련.] (http : /meta.stackexchange.com/questions/10216/can-we-disallow-the-use-of-belongs-on-xxxxxxx-and-not-programming-related-tag/10222#10222) (또한 3 편지, 그래서 [댓글 회신] (http://meta.stackexchange.com/questions/43019/how-do-comment-replies-work) 직장, 도움이 될 것입니다. :) –