Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
解決! メール送信 (2015)
Search
4D Japan
September 15, 2024
Technology
43
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
解決! メール送信 (2015)
4D Japan
September 15, 2024
More Decks by 4D Japan
See All by 4D Japan
4D 21 R2 R3
miyako
0
33
4D 21 LTS
miyako
0
18
4D 21
miyako
0
47
4D 20 R10
miyako
0
53
4D 20 R9
miyako
0
42
4D 20 R7 & R8
miyako
0
87
Unicodeの話 (2007)
miyako
0
55
Unicodeの話 (2008)
miyako
0
61
Google Apps Integration (2012)
miyako
0
58
Other Decks in Technology
See All in Technology
Incremental HTTP
kazuho
4
1.6k
人にやさしく、AIにやさしく、書き手を選ばないIaCのガードレール再考 / Rethinking IaC Guardrails for Humans and AI Alike
kohbis
5
1.8k
「今盗んで、後で解く」に備える ― AWSのポスト量子暗号入門
yama3133
2
280
大阪オフィスに Unitree Go2 がやってきたので Physical AI やってみた
dafujii
0
150
BedrockとLambdaで作る リアルタイム進行型推理ゲーム
kawametho
0
120
【Findyテック文化祭ワークショップ】新卒エンジニア&採用担当と作る、 なりたい姿と今やるべき一歩
dip_tech
PRO
0
150
猫でもわかるKiro Web
kentapapa
1
160
1人アドミンな私はAWSアカウント申請をSlackで完結したい!
ysuzuki
0
100
いちAWSエンジニアのAI活用を振り返る #devio2026 / devio osaka 2026 kawahara
masahirokawahara
1
290
10年欲しかった音楽管理アプリを、AIと一緒に作りはじめた
judau
1
190
Making AI Agents Safe and Fast- Jev, Obsidian, and the Meta-Harness
x5gtrn
PRO
0
170
2026-09-26 Platform Engineering Kaigi 2026 インフラとアプリの境界線と委譲の設計 / Drawing the Infra and App Line
masasuzu
0
500
Featured
See All Featured
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
380
Six Lessons from altMBA
skipperchong
29
4.5k
Statistics for Hackers
jakevdp
799
230k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
590
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
Code Review Best Practice
trishagee
74
20k
The Limits of Empathy - UXLibs8
cassininazir
1
690
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
For a Future-Friendly Web
brad_frost
183
10k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
420
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.8k
We Have a Design System, Now What?
morganepeng
55
8.3k
Transcript
SSL・STARTTLS・UTF-‐‑‒8・HTML・添付ファイル 解決! メール送信
$hostName:="smtp.gmail.com" $from:="
[email protected]
" $to:="
[email protected]
" $subject:=… $body:=… $user:="
[email protected]
" $password:=… $useSSL:=1 $port:=465 $error:=SMTP_New
($smtpId) If (0=$error) Case of : (0#IT_SetPort (12;$port)) : (0#SMTP_Host ($smtpId;$hostName)) : (0#SMTP_From ($smtpId;$from)) : (0#SMTP_To ($smtpId;$to)) : (0#SMTP_Subject ($smtpId;$subject)) : (0#SMTP_Body ($smtpId;$body)) : (0#SMTP_Auth ($smtpId;$user;$password)) Else $error:=SMTP_Send ($smtpId;$useSSL) End case $error:=SMTP_Clear ($smtpId) End if v12.0 $error:=SMTP_SetPrefs (1;14;0) $error:=SMTP_Charset (1;1) ISO-‐‑‒2022-‐‑‒JP incomplete support UTF-‐‑‒8
v12.0 $error:=SMTP_SetPrefs (1;15;0) $error:=SMTP_Charset (1;1) UTF-‐‑‒8 code encoding header body
1 windows-‐‑‒1252 quoted-‐‑‒printable quoted-‐‑‒printable 2, 3, 4 us-‐‑‒ascii 7bit quoted-‐‑‒printable 5, 6, 7, 8 iso-‐‑‒8859-‐‑‒1 base64 quoted-‐‑‒printable 10, 14 iso-‐‑‒2022-‐‑‒jp base64 quoted-‐‑‒printable 15, 16 utf-‐‑‒8 (charset=shift-‐‑‒jis) base64 base64 Unicodeモードに関係なく,Internet Commands (~∼v13) に渡されたテキストは ⼀一旦,shift-‐‑‒jisに変換されなければならない。変換できない⽂文字は ? で置換される。 incomplete support UTF-‐‑‒8
$hostName:="smtp.gmail.com" $from:="
[email protected]
" $to:="
[email protected]
" $subject:=… $body:=… $user:="
[email protected]
" $password:=… $useSSL:=1 $port:=465 $error:=SMTP_New
($smtpId) If (0=$error) Case of : (0#IT_SetPort (12;$port)) : (0#SMTP_Host ($smtpId;$hostName)) : (0#SMTP_From ($smtpId;$from)) : (0#SMTP_To ($smtpId;$to)) : (0#SMTP_Subject ($smtpId;$subject)) : (0#SMTP_Body ($smtpId;$body)) : (0#SMTP_Auth ($smtpId;$user;$password)) Else $error:=SMTP_Send ($smtpId;$useSSL) End case $error:=SMTP_Clear ($smtpId) End if IMPLICIT MODE v12.1 SMTP over SSL SMTP over SSL SMTP over SSL $error:=SMTP_SetPrefs (1;14;0) $error:=SMTP_Charset (1;1)
IMPLICIT MODE v12.1 SMTP over SSL Error with AUTHENTICATION
$hostName:="smtp.gmail.com" $from:="
[email protected]
" $to:="
[email protected]
" $subject:=… $body:=… $user:="
[email protected]
" $password:=… $useSSL:=1 $port:=465 $error:=SMTP_QuickSend
($hostName;$from;$to;$subject;$body;$useSSL;$port;$user;$password) IMPLICIT v13.2 SMTP over SSL ポート番号・ユーザー名・パスワードを設定 (SMTP_̲Sendを使⽤用する必要なし) $error:=SMTP_SetPrefs (1;14;0) $error:=SMTP_Charset (1;1) SMTP over SSL
$hostName:="exchange.4d.com" $from:=“
[email protected]
" $to:="
[email protected]
" $subject:=… $body:=… $user:="keisuke.miyako" $password:=… $useSSL:=0 $port:=587 $error:=SMTP_QuickSend
($hostName;$from;$to;$subject;$body;$useSSL;$port;$user;$password) EXPLICIT v13.2 STARTTLS $error:=SMTP_SetPrefs (1;14;0) $error:=SMTP_Charset (1;1) STARTTLS STARTTLS: ⾮非SSLポート番号(Exchange: 587)に接続し,サーバーから要求された場合,SSL/TLSに移⾏行行する。
full support v14.0 UTF-‐‑‒8 $error:=SMTP_SetPrefs (1;14;0) $error:=SMTP_Charset (1;1) ISO-‐‑‒2022-‐‑‒JP code
encoding header body 1 utf-‐‑‒8 base64 base64 2, 3, 4 utf-‐‑‒8 base64 base64 5, 6, 7, 8 utf-‐‑‒8 base64 base64 10, 14 utf-‐‑‒8 base64 base64 15, 16 utf-‐‑‒8 base64 base64 SMTP_̲SetPrefs, SMTP_̲Charsetの指定に関係なく,Internet Commands (v14) に渡されたテキストは常にUnicode (UTF-‐‑‒8) で送信されるのはバグ。
$error:=SMTP_New ($smtpId) If (0=$error) Case of : (0#IT_SetPort (12;$port)) :
(0#SMTP_Host ($smtpId;$hostName)) : (0#SMTP_From ($smtpId;$from)) : (0#SMTP_To ($smtpId;$to)) : (0#SMTP_Subject ($smtpId;$subject)) : (0#SMTP_Body ($smtpId;$body;4)) : (0#SMTP_Auth ($smtpId;$user;$password)) Else $error:=SMTP_Send ($smtpId;$useSSL) End case $errorText:=IT_ErrorText ($error) $error:=SMTP_Clear ($smtpId) End if content-‐‑‒type v14.0 HTML Content-‐‑‒Type:text/html $error:=SMTP_AddHeader ($smtpId;"Content-Type";"text/html")
content-‐‑‒type 添付ファイル v14R4 $error:=SMTP_Attachment ($smtpId;$filePath;2;0;"";$contentType) code encoding 0 none 1
BinHex 2 Base64 3 AppleSingle 4 AppleDouble 5 AppleSingle+Base64 6 AppleDouble+Base64 7 UUEncode base64 ※最新のApple Mail/iOSはBinHex⾮非対応 code mode 0 append 1 over-‐‑‒write 2 remove append content-‐‑‒typeが省省略略された場合, 拡張⼦子に基づいて⾃自動的に追加
content-‐‑‒id 添付ファイル v14R4 $error:=SMTP_Attachment ($smtpId;$filePath;2;0;$contentId;$contentType) $error:=SMTP_New ($smtpId) If (0=$error) Case
of : (0#IT_SetPort (12;$port)) : (0#SMTP_Host ($smtpId;$hostName)) : (0#SMTP_From ($smtpId;$from)) : (0#SMTP_To ($smtpId;$to)) : (0#SMTP_Subject ($smtpId;$subject)) : (0#SMTP_Body ($smtpId;$body;4)) : (0#SMTP_Attachment ($smtpId;$logoPath;2;0;"image1")) : (0#SMTP_Auth ($smtpId;$user;$password)) Else $error:=SMTP_Send ($smtpId;$useSSL) End case $errorText:=IT_ErrorText ($error) $error:=SMTP_Clear ($smtpId) End if content-‐‑‒id <img src="cid:image1" alt="logo"> content-‐‑‒id
4D Write Pro v14R5 MIME $error:=SMTP_QuickSend ($hostName;$from;$to;$subject;$body;$param;$port;$user;$password) 11 12.1 13.2
14.0 14R5 no SSL 0 ⭕ STARTTLS 0 ⭕ ⭕ ⭕ SMTP over SSL 1 ⭕ ⭕ ⭕ ⭕ no SSL 2 ⭕ ⭕ ⭕ HTML/no SSL 4 ⭕ ⭕ HTML/STARTTLS 5 ⭕ ⭕ MIME/no SSL 8 ⭕ MIME/STARTTLS 9 ⭕