[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
1999/06/24 11:51 from msyk
Title: [teenbbs:0157] multi-part mime encoded mail 作成用 bat file

No.   : 157
Sender: msyk
URL   : 
Title : multi-part mime encoded mail 作成用 bat file

@echo off
if not "%1" == "-d" goto usage
bu -nboundary printf %%02d/%%02d/%%02d_%%02d:%%02d:%%02d,clockyear,clockmonth,clockday,clockhour,clockminute,clocksecond
ygrep -=hTb "/^$/,/^$/-1" "^To: .+@.+¥..+$" %2 >> send.txt
echo MIME-Version: 1.0>> send.txt
echo Content-Type: multipart/mixed; boundary="%boundary%">> send.txt
echo.>> send.txt
echo This is a multi-part message in MIME format.>> send.txt
echo.>> send.txt
echo --%boundary%>> send.txt
echo Content-Type: text/plain; charset="iso-2022-jp">> send.txt
echo Content-Transfer-Encoding: 7bit>> send.txt
ygrep -=hvTb "/^$/,/^$/-1" "^From: .+@.+¥..+$" %2 >> send.txt
echo.>> send.txt

if "%3" == "" goto usage

:repeat
echo --%boundary%>> send.txt
echo Content-Type: application/octet-stream; name="%3">> send.txt
echo Content-Disposition: attachment; filename="%3">> send.txt
echo Content-Transfer-Encoding: base64>> send.txt
echo.>> send.txt
mmencode -b %3 >> send.txt
echo.>> send.txt
shift
if "%3" == "" goto last
goto repeat

:usage
echo %0 -d [メイル・ファイル名] [添付ファイル名 1] [添付ファイル名 2] ...
if exist send.txt del send.txt
goto end

:last
echo --%boundary%-->> send.txt

:end

[レスを書く]