顯示具有 📧 EMail 標籤的文章。 顯示所有文章
顯示具有 📧 EMail 標籤的文章。 顯示所有文章

2024-12-17

📧E-Mail 研究:Outlook 字體的 CSS 設定

最近被 Outlook 弄的一個頭兩個大……( ̄┰ ̄*)

我知道 Outlook 之類的 E-Mail 軟體,對 CSS 、HTML 支援度不高,不過我沒想到 Outlook 光是字體就這麼複雜……

我的電腦有以下字體

字體 別名 備註
思源黑體 Source Han Sans TC 這是從 Adobe那下載下來的,所以 font name 不是 Noto Sans CJK TC 或是 Noto Sans TC
微軟正黑體 Microsoft Jheng Hei Windows 默認字體
Arial

2024-05-29

Microsoft Email SMTP 設定

不知為何還蠻難找到 MS 365 的 SMTP 設定,在此紀錄

host outlook-apaccentral.office365.com
port 587
protocol smtp
username 你的 Outlook mail,例如 john.smith@live.com
password Outlook 密碼
from username


另外,我是使用 Java + spring, spring 有兩個參數不確定是在其他程式語言對應的數值,所以在這邊先列一下:

spring.mail.properties.mail.smtp.starttls.enable=true
spring.mail.properties.mail.smtp.auth=true

2024-05-08

multipart Email 的 Content-Disposition 差異

如果我今天要寄一封 E-Mail,內文要有圖片,那整封信的內容可能如下:

Subject: This is a test mail!
From: test@example.com
Content-Type: multipart/mixed; boundary="qwertyuio"

--qwertyuio
Content-Type: text/html; name="example.html"

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8"/>
		<title>Example</title>
	</head>
	<body>
		<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. </p>
		<img alt="" src="cid:28ce9652-4476-4e3c-8e9a-5d1bbae4cd05" />
	</body>
</html>

--qwertyuio
Content-Type: image/jpeg; name="example.jpg"
Content-Disposition: attachment; filename="example.jpg"
Content-ID: 28ce9652-4476-4e3c-8e9a-5d1bbae4cd05

<image content>

--qwertyuio--