Linuxコマンドで添付ファイル付きのメールを送りたい場合の手順です。
下記内容をsendmail -i -tにパイプで渡します。
`
From: (送信元メールアドレス)
To: (送信先メールアドレス)
Subject: (件名)
Content-Type: multipart/mixed; boundary="BOUNDARY"
--BOUNDARY
(メール本文)
--BOUNDARY
--BOUNDARY
Content-Transfer-Encoding: base64
Content-Type: (コンテンツタイプ); name="(添付ファイル名)"
Content-Disposition: attachment; filename="(添付ファイル名)"
base64した添付ファイルの文字列
--BOUNDARY--
`
・コンテンツタイプにはapplication/pdf等添付ファイルに応じたものを入力します。
・boundary="BOUNDARY"のBOUNDARYは任意の文字列で大丈夫です。