Email header text/calendar vs text/plain

Discussion in '.NET' started by TimmyC, Jun 8, 2007.

  1. TimmyC

    TimmyC

    Joined:
    May 15, 2007
    Messages:
    3
    Location:
    London
    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:040000008200E00074C5B71WIBBLYWOBBLYWAAAAAGAAAWAAAGAAAWOOOOO
    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!
    TimmyC, Jun 8, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matthew Lenz
    Replies:
    0
    Views:
    510
    Matthew Lenz
    Feb 22, 2005
  2. Jeff Thies

    mailto link in plain text email

    Jeff Thies, Dec 23, 2004, in forum: HTML
    Replies:
    3
    Views:
    3,290
    Mark Parnell
    Dec 23, 2004
  3. Inkiniteo

    Plain text email?

    Inkiniteo, Jun 27, 2005, in forum: Python
    Replies:
    11
    Views:
    831
    Christos TZOTZIOY Georgiou
    Jun 28, 2005
  4. Rohit
    Replies:
    0
    Views:
    345
    Rohit
    Oct 18, 2008
  5. Irishmaninusa

    Sending email both as html and plain text

    Irishmaninusa, Nov 13, 2003, in forum: ASP General
    Replies:
    2
    Views:
    111
    Irishmaninusa
    Nov 14, 2003
Loading...

Share This Page