在Outlook中打开任务 [英] Open A Task in Outlook

查看:90
本文介绍了在Outlook中打开任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下代码,通过C#中的电子邮件发送预约。

当我从电子邮件中打开此文件时,前景将显示在按摩标签中。

现在,如果我想将它作为outlook中的任务打开,我该怎么办?





I have Following code for sending an appointment through Email in C#.
What happens is that when i open this file from email,the outlook will display it in a massage tab.
Now if i want to open it as a task in outlook,what should i do?


public string MakeHourEvent(string subject, string location,
    DateTime date, string startTime, string endTime)
   {
    string filePath = string.Empty;
    string path = HttpContext.Current.Server.MapPath(@"\iCal\");
    filePath = path + subject + ".ics";
    writer = new StreamWriter(filePath);
    writer.WriteLine("BEGIN:VCALENDAR");
    writer.WriteLine("VERSION:2.0");
    writer.WriteLine("PRODID:-//hacksw/handcal//NONSGML v1.0//EN");
    writer.WriteLine("BEGIN:VEVENT");
    string startDateTime = GetFormatedDate(date)+"T"+GetFormattedTime(startTime);
    string endDateTime = GetFormatedDate(date) + "T" + GetFormattedTime(endTime);
    writer.WriteLine("DTSTART:" + startDateTime);
    writer.WriteLine("DTEND:" + endDateTime);
    writer.WriteLine("SUMMARY:" + subject);
    writer.WriteLine("LOCATION:" + location);
    writer.WriteLine("END:VEVENT");
    writer.WriteLine("END:VCALENDAR");
    writer.Close();
    return filePath;
   }













public void SendMail(string from, string to, 
	string subject, string body, Attachment attachment)
   {
    MailMessage mail = new MailMessage(from, to, subject, body);
    mail.Attachments.Add(attachment);
    SmtpClient smtp = new SmtpClient("localhost");
    smtp.Send(mail);
    mail.Dispose();
   }

推荐答案

在microsoft outlook中打开任务



System.Diagnostics.Process.Start(mailto:Tomail?subject = subject_name Messege&body =+ MsgBody);





Tomail - >到邮件地址



subject_name - >主题应显示在Outlook主题框中



MsgBody - >想要发送的邮件正文
For open task in microsoft outlook

System.Diagnostics.Process.Start("mailto:Tomail?subject=subject_name Messege &body="+MsgBody);


Tomail->To Mail Address

subject_name ->Subject Should display in outlook subject box

MsgBody->Body of the mail which want send


这篇关于在Outlook中打开任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆