Search The ForumSearch   RegisterRegister  LoginLogin

MailBee SMTP

 AfterLogic Forum : MailBee SMTP
Subject Topic: Creating RTF Email Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
jonty
Newbie
Newbie


Joined: 07 February 2008
Online Status: Offline
Posts: 3
Posted: 05 August 2008 at 10:40pm | IP Logged Quote jonty

Hi,

I'm trying to create a message with RTF format using the Mailbee.SMTP object.

Basically I have a VB6 rich text control on my form and I create a message based on the contents of that control.

I set the BodyFormat of the message to 2 - RTF and then i set the BodyText of the message to either the Text or TextRTF property of the rich text control.

In both cases it creates the message with a plain text txt file attachment.

How do I get the rich text to display correctly in the message body?

Thanks

Jon
Back to Top View jonty's Profile Search for other posts by jonty
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 06 August 2008 at 3:10am | IP Logged Quote Andrew

You can create an RTF message as follows:

Code:
Set msg = CreateObject("MailBee.Message")

msg.BodyText = strRTF ' where strRTF contains necessary RTF text
msg.BodyFormat = 2
msg.SaveMessage "rtf.eml"


However, not all mailers support RTF formatted email messages. While Outlook Express and Mozilla Thunderbird don't support RTF formatted messages (display them as a plain text with RTF commands), The Bat! can show them correctly. Which mailer are you using?

All mailers support HTML formatted messages. To convert RTF to HTML, you can use any of third-party components, for instance: http://www.easybyte.com/products/rtf2html.html

Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 
jonty
Newbie
Newbie


Joined: 07 February 2008
Online Status: Offline
Posts: 3
Posted: 06 August 2008 at 9:19pm | IP Logged Quote jonty

Hi Andrew,

I'm using MS Outlook as a mail reader. Code snippet is below. BodyText parameter contains the RTF codes. This produces an email of type RichText with the body text attached as a text file containing the text including RTF codes.

Hope you can help.

Thanks
Jonathan


Private Function SendEmail(Recipient As String, Subject As String, BodyText As String) As Boolean


    Dim objMail As MailBee.SMTP
    Dim strErr As String
    Dim strCCAdd As String
    Dim strMsg As String
    Dim strBounceMB As String
       
    Set objMail = New MailBee.SMTP

    strBounceMB = GetApplicationSetting(SMTPBouncedMailbox, "")

    With objMail
    
       .BodyFormat = 2 'RTF
      
        .Message.Subject = Subject
        .Message.ToAddr = Recipient
        .Message.BodyText = BodyText
       
          
        SendEmail = .SendEx(strBounceMB)
        .Disconnect
       
    End With
    




End Function
Back to Top View jonty's Profile Search for other posts by jonty
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 06 August 2008 at 11:53pm | IP Logged Quote Andrew

Do you have an example of RTF e-mail message which is displayed in MS Outlook as you expect?

Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 
jonty
Newbie
Newbie


Joined: 07 February 2008
Online Status: Offline
Posts: 3
Posted: 07 August 2008 at 6:35pm | IP Logged Quote jonty

Hi Andrew,

Here's an example of outlook emails, one in the RTF format I would expect (RTF Test.msg) and the other is the example produced by the code already supplied (Mail bee RTF.msg). I have also included the text file that gets attached to the mail bee rtf.msg in case it's not in the message file.

sample emails

Regards

Jonathan
Back to Top View jonty's Profile Search for other posts by jonty
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 08 August 2008 at 3:11am | IP Logged Quote Andrew

Thank you for the messages you provided. These messages are in proprietary MS Outlook format (MSG). This format is supported by MS Outlook and MS Exchange only, other mailers (Outlook Express, Mozilla Thunderbird, The Bat, Eudora, etc) are not able to recognize this proprietary format.

MailBee.NET Objects supports standard EML format only (we're not sure if it's legally to build/parse the Outlook/Exchange proprietary format). The messages you provided cannot be composed as standard EML.

Even if one found a way to compose such a message, only MS Outlook would be able to display it. We recommend you to use HTML messages which are supported by all popular mailers nowadays.

Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide