I have attached a raw email message encoded Base64. I would like to extract the message body, and then decode it to utf-8. There don't seem to be any tags to identify the beginning and end of the body, so I'm at a loss as to how to do this. The code below is for a Sub I have created to decode Base64, but it does not deal with extracting the body. Is there a way of doing this? Any help gretly appreciated.
Best regards
Best regards
B4X:
Sub Base64Decode(MyString As String) As String
If Regex.Matcher2("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$", _
Regex.CASE_INSENSITIVE, MyString).Find = True Then
'Log("Base64Text")
Try
Dim su As StringUtils
Dim Data() As Byte = su.DecodeBase64(MyString)
MyString = BytesToString(Data, 0, Data.Length, "UTF8")
Catch
Log("LastException: " & LastException)
End Try
End If
Return MyString
End Sub