Search code examples
vb.netchilkatchilkat-email

chilkat method for reading a email message body


How to get the message body using chilkat .What is the method to retrieve the message body ?


Solution

  • According to their online docs the Email class has a property called Body that I would assume is what you're looking for?

    So it would just be:

    Dim obj As New Chilkat.Email()
    Dim bodyText As String = obj.Body
    

    Or if you want to specify HTML vs Plain Text you could use the GetHtmlBody and GetPlainTextBody methods of the same object.

    Edit: In response to comments.

    In that sample, try changing the line:

    bundle = mailman.GetAllHeaders(1)
    

    to

    bundle = mailman.CopyMail()
    

    And inside the loop you should be able to add:

    TextBox1.Text = TextBox1.Text & email.Body & vbCrLf & vbCrLf