CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #1
    Join Date
    Feb 2007
    Posts
    42

    Send mails with rtf format using smtp client

    Hi,
    I am developing a tool to send mail. I need that the user can send the mail with the body text in RTF format. Therefore the user can write and edit the body text and when he want push the send button and the mail is sended correctly.

    I have developed this tool using mapiex and works fine, the reciver get the mail and can see the body in RTF format.
    Now I need do the same using SMTP Client, System::Net::Mail (http://msdn.microsoft.com/en-us/libr...mtpclient.aspx), I send the mail but I don't know send mail with body in rtf format. The recivier always get the mail with the body text in text plain format. How I can do to send mails with body in RTF formats using SMTP Client?

    I have tried to add alternatvies view, for example:

    Code:
    MailMessage *mmsgMailMsg = new MailMessage();
    mmsgMailMsg->From = maAdressFrom;
    ...
    mmsgMailMsg->Body = sMessage.Trim();
    
    
    AlternateView *altViewRTF = AlternateView::CreateAlternateViewFromString(m_sBodyRTFText.Trim(),Encoding::ASCII,MediaTypeNames::Text::RichText);
    mmsgMailMsg->AlternateViews->Add(altViewRTF);
    ...
    I have checked the mail that recivie the outlook clients and always the body text is in plain text. If I check other clients I can see the same. In other clients I can see that the body in rtf format is attached to mail (I don't want this).

    Can any help me please?

    pd: I have searched a lot of webs to solve this issue but I don't get solve my issue, for example: http://social.msdn.microsoft.com/for...1-698f67a42321
    Last edited by molistok; May 25th, 2011 at 07:32 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured