Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Email header text/calendar vs text/plain

Reply
Thread Tools

Email header text/calendar vs text/plain

 
 
TimmyC TimmyC is offline
Junior Member
Join Date: May 2007
Location: London
Posts: 7
 
      06-08-2007
Hello!

There was a post about this before, but the solution provided there did not work for me. Here is the problem. (.net 1.1)

I create a MailMessage, set who its to, who its from, the SMTP server and give it a correct iCal Body (to the best of my knowledge, it works as a .ics file). I then set a Content-Type header to text/calendar. I send it to myself and I receive a plain text email. I examine the Content-Type in the message options (outlook 2003) and it is text/plain.

Its driving me crazy! I used a 3rd party tool and it just managed to create a 2nd Content-Type: text/calendar but it appears to be ignored. The body is still text!

Here is a snippet:

MailMessage oMail = new MailMessage();

oMail.To = "my address";
oMail.BodyFormat = MailFormat.Text;
oMail.BodyEncoding = System.Text.Encoding.ASCII;
oMail.From = "my address";
oMail.Priority = MailPriority.Normal;
oMail.Subject = "This is a test subject for this mail.";

oMail.Headers.Add("Content-Type", @"text/calendar; method=REQUEST; charset=US-ASCII");

oMail.Body = @"BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 11.0 MIMEDIR//EN
VERSION:2.0
METHOD:REQUEST
BEGIN:VEVENT
ATTENDEE;ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO:<my hotmail address>
ORGANIZER:MAILTO:<my address>
DTSTART:20070604T120000Z
DTEND:20070604T130000Z
LOCATION:Another test place
TRANSP:OPAQUE
SEQUENCE:0
UID:040000008200E00074C5B71WIBBLYWOBBLYWAAAAAGAAAW AAAGAAAWOOOOO
DTSTAMP:20070604T091607Z
DESCRIPTION:When: 04 June 2007 13:00-14:00 (GMT) Greenwich Mean Time : Dublin\, Edinburgh\, Lisbon\, London.\nWhere: Another test place\n\n*~*~*~*~*~*~*~*~*~*\n\nThis is a test body that was 2 tabs\n\nThat was 2 line breaks\n
SUMMARY:Another test meeting
PRIORITY:5
X-MICROSOFT-CDO-IMPORTANCE:1
CLASS:PUBLIC
END:VEVENT
END:VCALENDAR

.";

SmtpMail.SmtpServer = "217.29.193.42";
SmtpMail.Send(oMail);

There is some other code i have in between which is irrelovant to the mail sending (displaying headers of mail before send on a web page, a commented out attachment etc).

Any help is desperately needed and greatly appreciated! Thanks in advance!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Header files with "header.h" or <header.h> ?? mlt C++ 2 01-31-2009 02:54 PM
Email module, how to add header to the top of an email? David Erickson Python 6 01-27-2008 09:16 AM
Header files included in header files John Smith C Programming 18 07-24-2004 04:55 AM
What is better /standard for creating files. a cpp file with header or cpp and seperate file for header DrUg13 C++ 1 02-10-2004 09:20 AM
how to avoid using another header file inside a header file? Newsgroup - Ann C++ 4 11-02-2003 01:20 PM



Advertisments