(Xojo Plugin) Access Attached Message (Embedded Email)
How to access an email embedded within another email (i.e. an attached message).
Dim email As New Chilkat.Email
// Load an email from a .eml
Dim success As Boolean
success = email.LoadEml("embeddedEmail.eml")
If (success <> True) Then
System.DebugLog(email.LastErrorText)
Return
End If
// Display how many attached emails are embedded within
// this one:
Dim numAttached As Int32
numAttached = email.NumAttachedMessages
System.DebugLog("numAttached = " + Str(numAttached))
// Get the 1st attached message.
Dim email2 As Chilkat.Email
email2 = email.GetAttachedMessage(0)
If (email.LastMethodSuccess = True) Then
// Display the subject, From, and a header field...
System.DebugLog(email2.Subject)
System.DebugLog(email2.From)
System.DebugLog(email2.GetHeaderField("X-SOMETHING"))
End If
|