MVCでASP.Netの電子メール通知機能を作成していて、今のところ基本的なことを学んでいます。私はまだ勉強しているコードからいくつかの質問があります:Link。ASP.Net MVCでLotus Notes電子メール通知を設定する
1. sServerName
- どこからLotus Notesでサーバー名を見つけることができますか?私はここにどのような価値を置くべきか分かりません。
2. password
- ここで送信者のLotus Notesパスワードを使用していますか?
3. Controller
にActionResult
というコードを入れて、View
のボタンで呼び出す予定です。このメソッドは、電子メールの実行が終了した後にView
を返します。これは正しいです?
4.ポートが定義されていないことがわかりました。ポートが定義されていない場合は問題ありませんか?私のreasearchに基づいて、LNはSMTPを使用して電子メールを送受信するときにポート25を使用します。
NotesSession _notesSession = new NotesSession();
NotesDocument _notesDocument = null;
string sServerName = "ServerName";
string sMailFile = "mail\\UserName.nsf";
string password = "Password";
string sSendTo = "emailaddress.domain.com";
string sSubject = "Testmail";
_notesSession.Initialize(password);
NotesDatabase _notesDataBase = _notesSession.GetDatabase(sServerName, sMailFile, false);
if (!_notesDataBase.IsOpen)
{
_notesDataBase.Open();
}
_notesDocument = _notesDataBase.CreateDocument();
_notesDocument.ReplaceItemValue("Form", "Memo");
_notesDocument.ReplaceItemValue("SendTo", sSendTo);
_notesDocument.ReplaceItemValue("Subject", sSubject);
NotesRichTextItem _richTextItem = _notesDocument.CreateRichTextItem("Body");
_richTextItem.AppendText("Test only message. " + "\r\n");
_notesDocument.Send(false);
_richTextItem =null;
_notesDocument =null;
_notesDataBase =null;
_notesSession =null;
フィリップ、あなたはそのパスを下りたくないです。それは暗くて痛い。 NotesのCOMサポートはサーバークラス通信のためのものではありません – stwissel