나는 비밀번호 찾기 기능을 잊고 있습니다.SendAsync 메서드에서 Web.Config에서 메일 설정 가져 오기?
SmtpClient client = new SmtpClient();
return client.SendMailAsync(ConfigurationManager.AppSettings["SupportEmailAddr"],
message.Destination,
message.Subject,
message.Body);
을 나는이 무엇인지 아무 생각이 없다 : AppSettings["SupportEmailAddr"]
web.config
에서 설정을 읽으려고하고 내
SendAsync
방법에서
<system.net>
<mailSettings>
<smtp from="email">
<network host="host" port="25" userName="" password="=" enableSsl="true" />
</smtp>
</mailSettings>
</system.net>
: 내 web.config
파일에서 나는 메일 설정을 수행 한
나는 이것을 here에서 가져 왔습니다.
그것은 예외 다음 날주고있다 :
Value cannot be null. Parameter name: from
그래서 SupportEmailAddr을 사용하여 구성 파일에 새 키를 추가해야합니다. 다른 설정은 그대로 두십시오. –
@MHussain 네가 이미 정확한 설정을하지 않았다면 네. 이미 사용하고 싶은 설정이있는 경우. 'ConfigurationElement.AppSettings [ "SupportEmailAddr"]'에서'SupportEmailAddr'을 사용하고자하는 키로 변경하십시오. 예 : 'ConfigurationManager.AppSettings [ "MyOtherKey"]' –
지금 이메일을 재설정하고 있습니다. 그러나 다음과 같은 오류가 발생하는 링크를 클릭 할 때 : '잠재적으로 위험한 Request.QueryString 값이 클라이언트에서 발견되었습니다 (코드 = "... QQ =="> 여기 a ")' –