我想发送附件从莲花笔记的电子邮件。发送电子邮件从莲花笔记与附件使用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)”。如果代码加载失败,代码永远不会得到那么多。 –