I try to include different type of files when sending mail with swaks (Swiss Army Knife for SMTP).
html as body and pdf as attchments.
From="me@example.com"
Passw="abc123"
To="you.example.com"
Server="smtp.example.com:587"
Signatur="sign.html"
Subjects="The subject of mail"
Attach=" --attach-type application/pdf --attach=file1.pdf --attach=file2.pdf --attach=file3.pdf"
swaks --attach-type text/htm" --body "$Signatur" --to "$To" --server "$Server" --auth-user "$From" --auth-password "$Passw" -tls --tls-protocol tlsv1_3 --h-Subject "$Subjects" "$Attach"
With pdf as attchments the html file is not formatted in the received e-mail, but with all the fortmatting hyper text (like
and so on) in plain text.
Without pdf attchments the e-mail got formated as html with fonts, colors and links.
Is it possible to have formatted text as body and attacments in swaks?
Log of body when sending mail with both html as body and attached pdf (resulting mail with
and so on)
~> Content-Type: multipart/mixed; boundary="----=_MIME_BOUNDARY_000_15946" ~>
~> ------=_MIME_BOUNDARY_000_15946
~> Content-Type: **text/plain**
~>
~> <!DOCTYPE html>
~> <html>
~> <body>
~>
~> <font size="-1">Hej,<br>
~> <br>
~> Här kommer
… and without pdf, if swaks command is left out with the “$Attach” (nice mail but without pdf-attachments)
~> Content-Type: **text/html**
~>
~> <!DOCTYPE html>
~> <html>
~> <body>
~>
~> <font size="-1">Hej,<br>
~> <br>
~> Här kommer