欢迎您访问我爱IT技术网,今天小编为你分享的编程技术是:【如何在 C# 中发起会议之类的特殊邮件】,下面是详细的分享!
如何在 C# 中发起会议之类的特殊邮件
以下为引用的内容:
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Office.Interop.Outlook;
////////////////////
/* 调用Outlook api 发起会议
/* mcjeremy@cnblogs.com
////////////////////
namespace OutlookAPI
{
class Program
{
static void Main(string[] args)
{
try
{
ApplicationClass oApp=new Microsoft.Office.Interop.Outlook.ApplicationClass();
//会议是约会的一种
AppointmentItem oItem=(AppointmentItem)oApp.CreateItem(OlItemType.olAppointmentItem);
oItem.MeetingStatus=OlMeetingStatus.olMeeting;
oItem.Subject="主题";
oItem.Body="内容";
oItem.Location="地点";
//开始时间
oItem.Start=DateTime.Now.AddDays(1);
//结束时间
oItem.End=DateTime.Now.AddDays(2);
//提醒设置
oItem.ReminderSet=true;
oItem.ReminderMinutesBeforeStart=5;
//是否全天事件
oItem.AllDayEvent=false;
oItem.BusyStatus=OlBusyStatus.olBusy;
//索引从1开始,而不是从0
//发件人的帐号信息
oItem.SendUsingAccount=oApp.Session.Accounts[2];
//添加必选人
Recipient force=oItem.Recipients.Add("mailuser2@mailserver.com");
force.Type=(int)OlMeetingRecipientType.olRequired;
//添加可选人
Recipient opt=oItem.Recipients.Add("mailuser3@p.mailserver.com");
opt.Type=(int)OlMeetingRecipientType.olOptional;
//添加会议发起者
Recipient sender=oItem.Recipients.Add("mailuser1@mailserver.com");
sender.Type=(int)OlMeetingRecipientType.olOrganizer;
oItem.Recipients.ResolveAll();
//oItem.SaveAs("d:/TEST.MSG", OlSaveAsType.olMSG);
oItem.Send();
//MailItem mItem=(MailItem)oApp.CreateItem(OlItemType.olMailItem);
//Recipient rTo=mItem.Recipients.Add("****");
//rTo.Type=(int)OlMailRecipientType.olTo;
//Recipient rCC=mItem.Recipients.Add("****");
//rCC.Type=(int)OlMailRecipientType.olCC;
//Recipient rBC=mItem.Recipients.Add("****");
//rBC.Type=(int)OlMailRecipientType.olBCC;
Console.WriteLine("OK");
}
catch (System.Exception ex)
{
Console.WriteLine(ex.Message);
}
Console.ReadLine();
}
}
}
以上所分享的是关于如何在 C# 中发起会议之类的特殊邮件,下面是编辑为你推荐的有价值的用户互动:
相关问题:outlook发出的会议邮件如何取消
答:当会议邀请发出后,如果对方接受,在他的日历里会出现该会议。如果你想取消会议,可以在你自己的日历中右键点击该会议,选择取消,这时候会提示你再次给之前的会议接收人发送会议取消的更新,选择发送,则对方会再次收到会议取消的邮件。 >>详细
相关问题:Outlook发送年度会议邀请(接受者可以直接保存到自...
答:你这个需求应该是没法实现的,除非是重复会议。因为每个会议本身都会去和与会者检查是否会有日期的冲突,而且每个会议都需要单独来进行接受的。 有另外一种办法,就是你的整个team会有一个共享的日历,你可以在这个共享日历上进行会议的设置,这... >>详细
相关问题:Onenote中“通过电子邮件发送会议笔记”如何实现?(...
答:for 50 msgbox "Press Ctrl+Shift+E"next >>详细
- 评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
-
