How can I send task request using vCalender/VTodo component using C#

Status
Not open for further replies.
Outlook version
Email Account
POP3
Hi,




I am writing a separate application to send task requests to the client using simple mail. Then the emails should be added to the mail box task list box in MS Outlook.


Here I have used vCalender/vTodo format to set values . But when I send the email it is not sending as a task request and it displays as an email but it is not added to the task list box. That is the question I have.




1. My Outlook version -2007.




2. language - C#.net




3. An Outlook add-in or Outlook automatic application?
Not a Add-in. A separate application there should not be a reference to the Outlook.


4. Visual Studio version - VS 2008




This is what I did.



public string CreateVTODO(DateTime start, DateTime end, String body, String sub, String status)



{
//Here I am not using parameters in method body.



StringBuilder sbvCalender2 = new StringBuilder();
sbvCalender2.Append("METHOD: REQUEST");
sbvCalender2.Append("\n");
sbvCalender2.Append("BEGIN:VCALENDAR");
sbvCalender2.Append("\n");
sbvCalender2.Append("PRODID:-//ABC Corporation//NONSGML My Product//EN");
sbvCalender2.Append("\n");
sbvCalender2.Append("BEGIN:TODO");
sbvCalender2.Append("\n");
sbvCalender2.Append("20110502T134500Z");
sbvCalender2.Append("\n");
sbvCalender2.Append("SEQUENCE:2");
sbvCalender2.Append("\n");
sbvCalender2.Append("UID:manula.m@eyepax.com");
sbvCalender2.Append("\n");
sbvCalender2.Append("ORGANIZER:MAILTO:derick.k@eyepax.com");
sbvCalender2.Append("\n"); sbvCalender2.Append("ATTENDEE;PARTSTAT=ACCEPTED:MAILTO:derick.k@eyepax.com");
sbvCalender2.Append("\n");
sbvCalender2.Append("DUE:20110502T134500Z");
sbvCalender2.Append("\n");
sbvCalender2.Append("STATUS:NEEDS-ACTION");
sbvCalender2.Append("\n");
sbvCalender2.Append("SUMMARY:Kolkata Kinght Riders");
sbvCalender2.Append("\n");
sbvCalender2.Append("END:VTODO");
sbvCalender2.Append("\n");
sbvCalender2.Append("END:VCALENDAR");
return sbvCalender2.ToString();
}



public void SendmsgVTODO(DateTime start, DateTime end, String body, String sub, String status)



{



MailMessage mail = new MailMessage();
SmtpClient client = new SmtpClient();
//Set the date and time



DateTime startDate = start;
DateTime endDate = end;

//Location where you want to save the vCalendar file



string attachUrl = @"E:\SaveVCalenderFile\Test.vcs";



//Create task



using (StreamWriter sw = new StreamWriter(attachUrl))



{
sw.Write(CreateVTODO(startDate, endDate, body, sub, status));
}



//Attach the task



Attachment mailAttachment = new Attachment(attachUrl);
mail.Attachments.Add(mailAttachment);
MailAddress fromAdd = new MailAddress("sandun.k@eyepax.com");
mail.To.Add("manula.m@eyepax.com");
mail.From = fromAdd;
mail.Subject = "Test New Dk";
mail.Body = sbvCalender2.ToString();
mail.BodyEncoding = System.Text.Encoding.UTF8;
mail.IsBodyHtml = true;
client.Host = "smtp.gmail.com";
client.Port = 587;
client.UseDefaultCredentials = true;
client.Credentials = new NetworkCredential("eyepaxtest@gmail.com", "eyepax563");
client.Send(mail);
mailAttachment.Dispose();
}




Please help me.






Regards,




Manula
 
Hi Diane,

Thank you very much for your information. I am really confused coz of this problem and solution is not found yet. Hope your information will help a lot.

Regards,

Manula
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
M How can I send a Task Request using vCalender/vTodo format using C# Using Outlook 3
D Using a VBA Custom Form to Send Reoccurring Email Upon Task Completion Outlook VBA and Custom Forms 4
Z Item.Recipients for Task Assignment on Send Outlook VBA and Custom Forms 10
E Send a Reminder/Task to certain Email Recipient Using Outlook 5
Diane Poremsky Send a Task Status Report Using Outlook 0
S How to send an OUTLOOK task to a contact out of my active directory? Using Outlook 2
M Send email on task creation? Using Outlook 2
A Send Email to Task while sending to Email address Outlook VBA and Custom Forms 1
O Scheduled Task Fails running Code to send Outlook Mail from Excel. Outlook VBA and Custom Forms 9
K send email when task changes Outlook VBA and Custom Forms 3
J Outlook VBA to send from Non-default Account & Data Files Outlook VBA and Custom Forms 2
C Synchronization and taking forever to send Using Outlook 2
D Send on behalf of does not store the base mailbox Using Outlook 0
R Outlook 365 VBA AUTO SEND WITH DELAY FOR EACH EMAIL Outlook VBA and Custom Forms 0
S Outlook 2002- "Send" button has disappeared. Help please. Using Outlook 1
TomHuckstep Remove Send/Receive All Folders (IMAP/POP) button from Outlook 365 Ribbon Using Outlook 2
J Macro to send email as alias Outlook VBA and Custom Forms 0
F Add a category before "Send an Email When You Add an Appointment to Your Calendar" Outlook VBA and Custom Forms 0
W Outlook 365 I am getting the "Either there is no default mail client" error when I try to send an email on excel Office 365 Using Outlook 1
T Outlook 2010 recipient no longer shows in 'Send To' Using Outlook 0
Witzker Outlook 2019 Macro to send an Email Template from User Defined Contact Form Outlook VBA and Custom Forms 0
Geldner Tweak Junk Email Reporting tool to default to particular email on send? Using Outlook 3
Geldner Send / Receive a particular group via macro or single keypress Using Outlook 1
E Outlook - Macro - send list of Tasks which are not finished Outlook VBA and Custom Forms 3
L How to avoid issues with "Send on Behalf" Using Outlook 3
M Outlook 365 refuses to send email Using Outlook 0
A Change settings Send/receive VBA Outlook VBA and Custom Forms 0
M I cant send emails via Outlook in my W10 PC. Using Outlook 3
K Run a script rule to auto 'send again' on undeliverable emails? Outlook VBA and Custom Forms 1
G Send a greeting message to a contact on birthday Outlook VBA and Custom Forms 5
T Outlook creates a copie of every mail I send Using Outlook.com accounts in Outlook 4
R How to restrict GWSMO sync to Outlook Send/Receive cycles Using Outlook 0
M Outlook, send to > mail recipient - results in plain text email Using Outlook 1
A Unflag Inbox and Flag Inbox with Orange Category After Item is send Outlook VBA and Custom Forms 3
glnz O365 - How to send from acct 2 but showing email name from acct 1 as From - alias? Using Outlook 0
S Outlook Macro to send auto acknowledge mail only to new mails received to a specific shared inbox Outlook VBA and Custom Forms 0
diver864 vba for a rule to automatically accept meeting requests with 'vacation' in subject, change to all-day event, change to free, don't send reply Outlook VBA and Custom Forms 1
PGSystemTester VBA To Change AppointmentItem.BusyStatus From MeetingItem Before Send Using Outlook 0
C Synchronizing subscribed folders causes hanging during send/receive process Using Outlook 2
M Extract all links from Outlook email, send to Excel Using Outlook 2
A VBA macro for 15 second loop in send and received just for 1 specific mailbox Outlook VBA and Custom Forms 1
O Outlook 365 - suddenly unable to send using Gmail POP3 Using Outlook 10
T After I send a new email, it remains in the Draft folder Using Outlook.com accounts in Outlook 3
B Programmatically force html send and insert clipboard contents into body Outlook VBA and Custom Forms 0
S Change VBA script to send HTML email instead of text Outlook VBA and Custom Forms 3
M ERROR: None of your email accounts could send to this recipient Using Outlook 2
C Send/receive error 80040119 Using Outlook 2
J Send Again NDR Outlook VBA and Custom Forms 1
J Add an Attachment Using an Array and Match first 17 Letters to Matching Template .oft to Send eMail Outlook VBA and Custom Forms 2
ChrisK2 Send email to advertise@slipstick.com fails: "The group advertising isn't set up to receive messages from..." Using Outlook 3

Similar threads

Back
Top