shell发送包含图片的邮件
鐢?hell 鐢戝皝html鐢鐢鐢鐢鐢鐢鐢鏍煎紡偖
cat mail|sendmail -t
鐢鐢腑mail涓
To鐢鐢x@111.com
Subject:aaa
content-type:text/html
html
img src= aa /
/html
鐢?hell鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢戝寘鍚檮閭涔,
(cat mail;uuencode a.jpg a.jpg)|sendmail -t
mail涓
To鐢鐢x@111.com
Subject:aaa
浣嗘濡傛灉冲閭姝,涓ラ檮鐗囷細鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢 (cat mail;uuencode a.jpg a.jpg)|sendmail -t
To鐢鐢x@111.com
Subject:aaa
content-type:text/html
html
img src= aa /
/html
鐢鐢鐢鐢灉浼sendmial鐢鐢鐢嗛檮.jpg鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢栫鍚庤杞介偖舵囷紝涔氨鏄織扮涔閭,,
閭,涔堝姙鍛紵鐢鐢
鐢鐢鐢鐢堟浜嗚Вmime鐢鐢鐢鐢鐢勬蹇紝MIME鐢鐢鐢鐢鐢鐢鐢 囧取版Multipurpose Internet Mail Extensions
澶氬絀鐢鐢鐢nternet 鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢 閭鎵?厖鏈姟屽畠鏄竴戦檯閭鎵?厖鍗,
涓皝宓屽勪涓鍥墖偖紝卞緱悎鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢mime鐢鐢鐢鍗
鐢夌发rcf2046鐢鐢鐢涓墍璇#section-5.1.1
褰撻偖腑闇涓釜鍥墖勪鏃鏍煎紡涓猴細鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢
鐢寮曠
MIME-Version: 1.0
Content-type: multipart/mixed; boundary= 123
This is the preamble. It is to be ignored, though it
is a handy place for composition agents to include an
explanatory note to non-MIME conformant readers.
--123
Content-Type: image/jpeg; name=a.jpg
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=a.jpg;
a.jpg鐢鐢ase64鐢 鏁版
--123--
鑰屼竴涓瀹逛鐢鐢鐢鐢鐢html鐢鐢鐢鐢鐢鐢鐢鐢鐢偖舵牸寮
鐢寮曠
MIME-Version: 1.0
Content-type: multipart/mixed; boundary= 123
This is the preamble. It is to be ignored, though it
is a handy place for composition agents to include an
explanatory note to non-MIME conformant readers.
--123
Content-Type: text/html; charset=gbk; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
html鐢鐢 ,
--123--
鐢鐢鐢鐢悎涓
鐢寮曠
MIME-Version: 1.0
Content-type: multipart/mixed; boundary= 123
This is the preamble. It is to be ignored, though it
is a handy place for composition agents to include an
explanatory note to non-MIME conformant readers.
--123
Content-Type: text/html; charset=gbk; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
html鐢鐢 ,
Content-Type: image/jpeg; name=a.jpg
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=a.jpg;
a.jpg鐢鐢ase64鐢 鏁版
--123--
閭鏍煎紡涓鎹鏄鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢崗璁渶紝涓嶈兘佸,
娉剰鐢鐢
1 鐢鐢鐢鐢鐢鐢鐢鑾峰彇鏌鍥墖ase64鐢鐢鐢鐢鐢鐢鐢鐢栫勬娉曚cat a.jpg |uuencode --base64 a.jpg temp 2 鐢鐢寰埌a.jpg鐢鐢鐢鐢鐢鐢鐢鐢紪鐮佸悗閫氳繃sed鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鍛戒鏉ュ鎺夌涓鍜渶鍚竴琛屻鍥犱竴琛,begin base64 xxxx,鐢鐢鏈悗涓鏄===
3 html鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢,閲栭檮鏄img src= filename
4 鐢鐢鐢鐢鐢鐢鐢勪鏍煎紡鍜宑ontent-type鐢鐢鐢鐢鐢鐢鐢鐢搴斿叧媓ttp://www.webmaster-toolkit.com/mime-types.shtml
涓婇潰墖靛啀鍔犱笂閭澶撮儴屽緱鍒版秏鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢ail
鐢鐢鐢悗浣跨cat mail|sendmail -t鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢鐢卞彲ュ閫佸寘鍚鐗閭浜