我正在尋找一種方法來閱讀和使用Outlook 2013中的快速步驟,但是我無法在該語言的文檔中找到任何內容。 Here's我的代碼至今:在ASP.NET 2013中閱讀和使用Outlook 2013中的快速步驟
using livingTheFantasy = Microsoft.Office.Interop.Outlook;
using OutlookApp = Microsoft.Office.Interop.Outlook.Application;
namespace outlookPrimeiro
{
public partial class _Default : Page
{
protected void Page_Load(object sender, EventArgs e)
{
String toEmail = "[email protected]";
String ccEmail = "[email protected]";
//String bccEmail = "";
String subjectEmail = "using Outlook 2013";
String body = "body";
OutlookApp appDoOutlook = new OutlookApp();
livingTheFantasy.MailItem itemDoMail = appDoOutlook.CreateItem(livingTheFantasy.OlItemType.olMailItem);
string accName = "[email protected]";
livingTheFantasy.NameSpace sessao = itemDoMail.Session;
livingTheFantasy.Accounts contaAccounts = sessao.Accounts;
for (int i = 1; i <= contaAccounts.Count; i++)
{
livingTheFantasy.Account contaAccount = contaAccounts[i];
if (contaAccount.DisplayName.ToLower() == accName.ToLower())
{
itemDoMail.SendUsingAccount = contaAccount;
Marshal.ReleaseComObject(contaAccount);
break;
}
}
itemDoMail.To = toEmail;
itemDoMail.CC = ccEmail;
//itemDoMail.BCC = bccEmail;
itemDoMail.Subject = subjectEmail;
itemDoMail.HTMLBody = body;
itemDoMail.Importance = livingTheFantasy.OlImportance.olImportanceHigh;
//itemDoMail.Send();
itemDoMail.Display(false);
Marshal.ReleaseComObject(contaAccounts);
Marshal.ReleaseComObject(sessao);
}
}
}
我不能使用第三方軟件。第一個解決方案在這裏沒有工作。 –
哪個解決方案不起作用? –
這裏沒有2個解決方案? –