Kitura / Swift-SMTP

Swift SMTP client
Apache License 2.0
260 stars 60 forks source link

HTML related attachment image not work on gmail mail #110

Open RuchiMakadia opened 4 years ago

RuchiMakadia commented 4 years ago

Hello I have a face issue when i add html content with related attachment and send it to mail send function Using below CONTENT-ID that work only in iphone mail not in gmail mail. In gmail mail it take as a attachment instead of html src.

// Create a file `Attachment`
let fileAttachment = Attachment(
    filePath: "~/img.png",          
    // "CONTENT-ID" lets you reference this in another attachment
    additionalHeaders: ["CONTENT-ID": "img001"]
)

// Create an HTML `Attachment`
let htmlAttachment = Attachment(
    htmlContent: "<html>Here's an image: <img src=\"cid:img001\"/></html>",
    // To reference `fileAttachment`
    related: [fileAttachment]
)

Thank you Ruchi