Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send HTML EMail #138

Open
simongiesen opened this issue Aug 11, 2024 · 2 comments
Open

Send HTML EMail #138

simongiesen opened this issue Aug 11, 2024 · 2 comments

Comments

@simongiesen
Copy link

simongiesen commented Aug 11, 2024

Hi everybody,

I did not find a function how to send HTML Email. Could you help, please?

@dorianborovina
Copy link

+1

Me neither, trying to figure out.

@simongiesen
Copy link
Author

// create mail and put the HTML content in the text field
let mail = Mail(
    from: from,
    to: [to],
    subject: "HTML E-Mail Beispiel",
    text: htmlBody  // HTML content here
)

// set MIME-Type as HTML
mail.headers["Content-Type"] = "text/html; charset=utf-8"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants