インライン画像を含む HTML メールを送信しようとしています。以下のテキストは要約されていますが、問題なく動作します。
theString=paste0(
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>HTML demo</title>
<style type="text/css">
</style>
</head>
<body>
<h1>Notes</h1>
'</body>
</html>'
msg = mime_part(theString)
## Override content type.
msg[["headers"]][["Content-Type"]] = "text/html"
sendmail(from = "mschindel@sunrun.com",
to = c("mschindel@sunrun.com"),
bcc=bccList,
subject = theSubject,
msg = msg,
html = TRUE,
smtp = list(
host.name = "aspmx.l.google.com",
port = 25,
user.name = "***",
passwd = "***",
ssl = TRUE
),
authenticate = TRUE,
send = TRUE
)
*.png 画像をインラインで送信できるようにしたいと考えています (したがって、おそらく HTML の "Notes" ヘッダーの後)。
ホーム ディレクトリに *png ファイルのセットがありますが、画像を添付またはインライン化する方法がわかりません。
ありがとうございました!