【发布时间】:2017-06-28 15:06:08
【问题描述】:
我正在开发使用 EWS 托管 API 向 Outlook 收件人发送约会的应用程序, 现在需要在约会中添加附件,我可以将附件附加到电子邮件中,但是当我使用与将项目附件附加到电子邮件相同的技术时,但附件没有附加,我的代码如下
public string sendCalanderEvntAsReply( EntityLayer.Data_Contracts.AppointmentDTO appointment)
{
Appointment app = new Appointment(service);
app.Subject = appointment.Subject;
app.Body = appointment.Body;
app.Start = Convert.ToDateTime(appointment.Start);
app.End = Convert.ToDateTime(appointment.End);
app.Location = appointment.Location;
foreach (string obj in appointment.Attendees)
{
app.RequiredAttendees.Add(obj);
}
if (appointment.Attachments != null &&
appointment.Attachments.Count > 0)
{
foreach (var att in appointment.Attachments)
{
app.Attachments.AddFileAttachment(att.FileName);
}
}
app.Save(SendInvitationsMode.SendToAllAndSaveCopy);
}
我的代码有什么问题吗? 请帮忙。
谢谢
【问题讨论】:
标签: c# outlook exchangewebservices appointment