Sample code for 30+ languages & platforms
Swift

Load MIME Object from Email Object

See more Email Object Examples

Demonstrates how to load a Chilkat Mime object from a Chilkat Email object. (Copies the email into a Mime object.)

Chilkat Swift Downloads

Swift

func chilkatTest() {
    var success: Bool = false

    let email = CkoEmail()!
    success = email.loadEml(mimePath: "qa_data/eml/sample.eml")

    // Write the full MIME of the email to a StringBuilder.
    let sbMime = CkoStringBuilder()!
    email.getMimeSb(sb: sbMime)

    // Load the MIME object from the StringBuilder
    let mime = CkoMime()!
    success = mime.loadSb(sb: sbMime)

    print("\(mime.getMime()!)")

}