本文介绍了如何使用群组电子邮件发送群组? (Outlook mailitem)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用发行/群组电子邮件地址发送电子邮件?
我的代码是获取当前在计算机上登录的用户的电子邮件地址。
我尝试了什么:
应用程序oApp = new Application();
MailItem oMailItem =(MailItem)oApp.CreateItem(OlItemType.olMailItem);
oMailItem.Recipients.Add(toTxtBox.Text);
oMailItem.CC = ccTxtBox.Text;
oMailItem.Subject = sbjTxtBox.Text;
string x = 跨度>;
string date = Session [ 日期跨度>]的ToString();
string to = Session [ to 跨度>]的ToString();
string subject =会话[ subject 跨度>]的ToString();
oMailItem.HTMLBody = bodyTxtBox.Text + getEmailFile(x);
if (FileUpload1.HasFile)
{
int AttachType =( int )OlAttachmentType.olByValue;
Attachment Attach = oMailItem.Attachments.Add(FileUpload1.PostedFile.FileName,AttachType,Type.Missing,Type.Missing);
}
((Microsoft.Office.Interop.Outlook._MailItem)oMailItem)。Send();
解决方案
How can I send an email using a distro/group email address?
My code is getting the email address of the user that is currently login on the computer.
What I have tried:
Application oApp = new Application(); MailItem oMailItem = (MailItem)oApp.CreateItem(OlItemType.olMailItem); oMailItem.Recipients.Add(toTxtBox.Text); oMailItem.CC = ccTxtBox.Text; oMailItem.Subject = sbjTxtBox.Text; string x =""; string date = Session["date"].ToString(); string to = Session["to"].ToString(); string subject = Session["subject"].ToString(); oMailItem.HTMLBody = bodyTxtBox.Text + getEmailFile(x); if (FileUpload1.HasFile) { int AttachType = (int)OlAttachmentType.olByValue; Attachment Attach = oMailItem.Attachments.Add(FileUpload1.PostedFile.FileName, AttachType, Type.Missing, Type.Missing); } ((Microsoft.Office.Interop.Outlook._MailItem)oMailItem).Send();
解决方案
这篇关于如何使用群组电子邮件发送群组? (Outlook mailitem)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!