赞
踩
引用Microsoft.Office.Interop.Outlook
Microsoft.Office.Interop.Outlook.Application olApp = new Microsoft.Office.Interop.Outlook.Application();
Microsoft.Office.Interop.Outlook.MailItem mailtem = (Microsoft.Office.Interop.Outlook.MailItem)olApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem);
mailItem.To = "123456789@test.com";//目标邮箱地址
mailItem.Subject = "Test Email";//邮件主题
mailItem.BodyFormat = Microsoft.Office.Interop.Outlook.OlBodyFormat.olFormatHTML;
mailItem.HTMLBody = "Hi Qi<br /> Long time no see~";//邮件内容
mailItem.Attachments.Add(filepath); //邮件附件 filepath附件路径 ((Microsoft.Office.Interop.Outlook._MailItem)mailItem).Send();
mailItem = null;
olApp = null;
MessageBox.Show("发送成功!");
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。