我想發送附件從蓮花筆記的電子郵件。發送電子郵件從蓮花筆記與附件使用asp.net c#
這個我試過下面的代碼,它顯示錯誤:
錯誤:
An exception of type 'System.Runtime.InteropServices.COMException' occurred in App_Web_sendemail.aspx.cdcab7d2.s2ysjl2c.dll but was not handled in user code
Additional information: Database open failed (xx.xxx.xxx.xxx!!names.nsf)
代碼:
Domino.NotesSession nSession = new Domino.NotesSession();
nSession.Initialize("bbau0862"); //Password
Domino.NotesDatabase nDatabase =
nSession.GetDatabase("xx.xxx.xxx.xxx", "names.nsf");
//If the database is not already open then open it.
if (!nDatabase.IsOpen)
{
nDatabase.Open();
}
Domino.NotesDocument nDocument = nDatabase.CreateDocument();
/*create string variable that will be passed to function. This way we setup To field value*/
string[] recipients =
{"[email protected]", "[email protected]"};
//setup Form
nDocument.ReplaceItemValue("Form", "Memo");
nDocument.ReplaceItemValue("SentTo", recipients); //To field
nDocument.ReplaceItemValue("Subject", "Message subject"); //message subject
nDocument.ReplaceItemValue("Body", "Something in the message body"); //set body text
nDocument.SaveMessageOnSend = true; //save message after it's sent
nDocument.Send(false, recipients); //send
請告訴我如何發送Lotus Notes電子郵件與ASP附件。淨。
謝謝。
這不是錯誤,他得到了「數據庫打開失敗(xx.xxx.xxx.xxx !! names.nsf)」。如果代碼加載失敗,代碼永遠不會得到那麼多。 –