Tuesday, 26 December 2017

5.1.7 Invalid address 原因在於設定寄信的To或From內容錯誤

5.1.7 Invalid address

原因在於設定寄信的To或From內容錯誤





Wrong Method:
message.From.Add(new MailboxAddress("no-reply@gmail.COM", "no-reply"));

Right (Correct) Method:
message.From.Add(new MailboxAddress("no-reply", "no-reply@gmail.COM"));

因為寄信的地址認不得,不是正常的格式,如XX@xx.com

No comments:

Post a Comment

IIS HTTP Error 403.18

 HTTP Error 403.18 - Forbidden The specified request cannot be processed in the application pool that is configured for this resource on the...