Web パーツのボタン クリック イベントでメールを送信しようとしています。しかし、メールの送信に失敗し、sharepoint ログとマシンのイベント ビューアーの両方にエラーが記録されます。エラー: SMTP ホストに接続できません
中央管理の送信メール設定は既に構成されています。アラートも正常に機能しています。
以下は私のコードです:
StringDictionary headers = new StringDictionary();
headers.Add("to", "someone@abc.com");
headers.Add("from", "MySharePointEmail@myfatblog.co.uk");
headers.Add("subject", "How to use SendEMail from SPUtility");
headers.Add("content-type", "text/html");
string bodyText = "This is the body of my email, in html format.";
SPUtility.SendEmail(SPContext.Current.Web, headers, bodyText);
前もって感謝します