Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
解決! メール送信 (2015)
Search
4D Japan
September 15, 2024
Technology
40
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
20
4D 21 LTS
miyako
0
17
4D 21
miyako
0
39
4D 20 R10
miyako
0
44
4D 20 R9
miyako
0
35
4D 20 R7 & R8
miyako
0
84
Unicodeの話 (2007)
miyako
0
45
Unicodeの話 (2008)
miyako
0
51
Google Apps Integration (2012)
miyako
0
53
Other Decks in Technology
See All in Technology
【CEDEC2026】『ウマ娘 プリティーダービー』 英語版のキャラクターの方言や口調をローカライズするための創造的アプローチ
cygames
PRO
1
200
生成 AI の基礎 〜 サンプル実装で学ぶ基本原理
enakai00
7
4.4k
認知負荷をGemini で溶かす — GKE 基盤「Orbit」における AI エージェントの実践
sansantech
PRO
1
270
TypeScript入門 2026
recruitengineers
PRO
3
500
Breaking the Seal: Static Deobfuscation of Compiled V8 JavaScript Bytecode Malware
hshrzd
0
670
つくって納得、つかって実感! 大規模言語モデルことはじめ ver2.0
recruitengineers
PRO
4
1.2k
Bill One 開発エンジニア 紹介資料
sansan33
PRO
7
19k
トヨタ⽣産⽅式(TPS)⼊⾨
recruitengineers
PRO
3
660
老害フォレンジッカーはAI羊の夢を見るか?
tadmaddad
0
310
AIは実装を速くする。では、私たちは何を今作るべきか?-立場を越えてリリースに向き合ったチーム開発の実践 / 20260801 Hiromi Nakaya and Naoki Takahashi
shift_evolve
PRO
3
450
グローバル基準のSREは、運用現場でどう機能したか:成熟度アセスメントの実践 / SRE NEXT 2026
sorawatanabe
0
140
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
53k
Featured
See All Featured
The Limits of Empathy - UXLibs8
cassininazir
1
600
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Music & Morning Musume
bryan
47
7.3k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
260
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
210
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Crafting Experiences
bethany
1
240
Amusing Abliteration
ianozsvald
1
240
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
170
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
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 ⭕