Tag: outlook 2003

如何为MS Outlook开发插件?

如何为适用于所有1. Outlook 2010 2. Outlook 2007 3. Outlook 2003的MS Outlook开发插件 我开发的插件适用于2010年和2007年,但不适用于2003年。 我希望这样的东西适用于以上所有三个:)

如何使用C#中的SMTPclient向gmail发送电子邮件?

我正在使用outloook 2003和visual studio 2008.我想开发一个将电子邮件发送到任何域的应用程序。 但是当我尝试向gmail,hotmail等发送电子邮件时,我的代码失败了。实际上所有邮件都存储在C:\Inetpub\mailroot\Queue目录中。 请帮我如何将电子邮件发送到gmail,hotmail a / c。 提前致谢 代码是 System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(); message.To.Add(“sumitdawar@hotmail.com”); message.To.Add(“sumitdawar@gmail.com”); message.Subject = “This is sample mail”; message.From = new System.Net.Mail.MailAddress(“Sumit.Dhingra@niit.com”); message.Body = “this is the message body”; System.Net.Mail.SmtpClient sss = new System.Net.Mail.SmtpClient(“HO-KKJ-MAIL.in.niit.com”); sss.UseDefaultCredentials = false; sss.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis; sss.Credentials = new System.Net.NetworkCredential(“Sumit.Dhingrar”, “password”,”domain”);

使用Redemption(Outlook)与登录用户以外的用户 – 并获取错误

我正在使用Redemption dll( http://www.dimastr.com/redemption/ ),我创建了一个访问我的邮箱的exe。 我在我的用户名下运行Windows调度程序中的exe,它工作正常,我收到一封电子邮件发送给我(见下面的代码)。 当我将Scheduler中的runas用户名更改为其他人并尝试访问他们的邮箱时,我收到错误。 System.IO.FileLoadException static void Main(string[] args) { System.Diagnostics.Debugger.Break(); object oItems; //string outLookUser = “My Profile Name”; string outLookUser = “Other User Profile Name”; string ToEmailAddress = “abc.email@xyz.com”; string FromEmailAddress = “abc.email@xyz.com”; string outLookServer = “exchangeServer.com”; string sMessageBody = “\n outLookUser: ” + outLookUser + “\n outLookServer: ” + outLookServer + […]

如何创建和发送约会到Microsoft Outlook日历?

我正在尝试使用以下代码在另一个人的Microsoft Outlook(2003)日历中创建约会。运行此程序时,约会将保存在我的日历中。但不会发送给收件人。 try { Microsoft.Office.Interop.Outlook.Application app = null; Microsoft.Office.Interop.Outlook.AppointmentItem appt = null; app = new Microsoft.Office.Interop.Outlook.Application(); appt = (Microsoft.Office.Interop.Outlook.AppointmentItem)app .CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olAppointmentItem); appt.Subject = “Meeting “; appt.Body = “Test Appointment body”; appt.Location = “TBD”; appt.Start = Convert.ToDateTime(“12/23/2009 05:00:00 PM”); appt.Recipients.Add(“smuthumari@mycompany.com”); appt.End = Convert.ToDateTime(“12/23/2009 6:00:00 PM”); appt.ReminderSet = true; appt.ReminderMinutesBeforeStart = 15; appt.Importance = Microsoft.Office.Interop.Outlook.OlImportance.olImportanceHigh; appt.BusyStatus = Microsoft.Office.Interop.Outlook.OlBusyStatus.olBusy; […]

无法转换COM对象 – Microsoft Outlook和C#

我已编写此代码以查看Outlook邮箱中的未读项目,以下是代码: Microsoft.Office.Interop.Outlook.Application app; Microsoft.Office.Interop.Outlook.Items items; Microsoft.Office.Interop.Outlook.NameSpace ns; Microsoft.Office.Interop.Outlook.MAPIFolder inbox; Microsoft.Office.Interop.Outlook.Application application = new Microsoft.Office.Interop.Outlook.Application(); app = application; ns = application.Session; inbox = ns.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox); items = inbox.Items; foreach (Microsoft.Office.Interop.Outlook.MailItem mail in items) { if (mail.UnRead == true) { MessageBox.Show(mail.Subject.ToString()); } } 但在foreach循环中我收到此错误: “无法将’System .__ ComObject’类型的COM对象强制转换为接口类型’Microsoft.Office.Interop.Outlook.MailItem’。此操作失败,因为QueryInterface调用COM组件为IID'{00063034-0000- 0000-C000-000000000046}’由于以下错误而失败:不支持此类接口(HRESULTexception:0x80004002(E_NOINTERFACE))。 你能帮我解决一下这个错误吗?

在生成的电子邮件中添加默认Outlook签名

我正在使用Microsoft.Office.Interop.Outlook.Application生成电子邮件并在用户发送之前将其显示在屏幕上。 该应用程序是一个winform应用程序,在.NET Framework 3.5 SP1以C#编码,它是Microsoft Outlook 2003 。 我使用以下代码: public static void GenerateEmail(string emailTo, string ccTo, string subject, string body) { var objOutlook = new Application(); var mailItem = (MailItem)(objOutlook.CreateItem(OlItemType.olMailItem)); mailItem.To = emailTo; mailItem.CC = ccTo; mailItem.Subject = subject; mailItem.HTMLBody = body; mailItem.Display(mailItem); } 我的问题是: 如何在生成的电子邮件body中插入/添加正在使用该应用程序的用户的默认签名? 任何帮助赞赏。