Method MIMEMessage():createFromString() Professional

Creates an instance of the MIMEMessage class from a string.

Syntax
:createFromString( <cString> ) --> oMimeMessage
Parameters
<cString>
The parameter cString is a character string that is to be transformed to an instance of the class MimeMessage.
Return

The method returns an instance of the MIMEMessage class.

Description

The method :createFromString() can be used to create an instance of the class MIMEMessage from a character string. The character string can be is retrieved via a POP3Client instance and its method :getMessageString():

... 
// Retrieve the first e-mail from the e-mail server as character string 
cMimeMessageString := oPop3Client:getMessageString(1) 

// Transform the string to an instance of the class MIMEMessage 
oMimeMessage := MimeMessage():createFromString( cMimeMessageString ) 
... 

This method is also usefull to process MIMEContent() objects that contain an e-mail. Whether an e-mail is contained in a MimeContent object can be examined via it's content type:

... 
cContentType := oMimeContent:getContentType() 
IF "message/rfc822" $ Lower(cContentType) 
   oMimeMessage := MimeMessage():createFromString( oMimeContent:getMessage() ) 
ENDIF 
... 

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.