B4X Requires Chilkat v11.0.0+
B4X
Set a MIME header on one attachment
See more Email Object Examples
Add a file using the content type required by the receiving application. Set Content-Description on the newly added MIME part and read it back from that part. The message-level headers have a separate collection.
Chilkat B4X Downloads
Dim success As Boolean = False
' Assumes Chilkat is unlocked. See Global Unlock Sample.
Dim email As ChilkatEmail
email.Initialize
email.From = "Workshop team <events@example.com>"
success = email.AddTo("Alex Rivera", "alex@example.net")
If success <> True Then
Log(email.LastErrorText)
Return
End If
email.Subject = "Workshop registration"
email.Body = "Attached is the requested data file."
success = email.AddFileAttachment2("sample.hpm", "application/x-hprimnet")
If success <> True Then
Log(email.LastErrorText)
Return
End If
Dim index As Int = email.NumAttachments - 1
email.AddAttachmentHeader(index, "Content-Description", "HPM/3.0")
Log(email.GetAttachmentHeader(index, "Content-Description"))
success = email.SaveEml("described-attachment.eml")
If success <> True Then
Log(email.LastErrorText)
Return
End If
Log("Saved described-attachment.eml.")