Created
July 23, 2012 15:44
ご送信防止秀丸メールマクロ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HMCheckToCC.mac | |
// 2006/03/23 | |
loaddll "tkinfo.dll"; | |
if (dllfunc("IsTuruKameMain")) { | |
message "このマクロは本体側では実行できません。"; | |
endmacro; | |
} | |
$selfDomain = "gamil.com"; | |
#errorFlag = 0; | |
$messageBox = ""; | |
$searchString[0] = "To"; | |
$searchString[1] = "Cc"; | |
#searchStringNum = 2; | |
#i1 = 0; | |
#i2 = 0; | |
#i3 = 0; | |
#i4 = 0; | |
#i5 = 0; | |
#j1 = #searchStringNum; | |
#j2 = 0; | |
#j3 = 0; | |
#j4 = 0; | |
#j5 = 0; | |
$s1 = ""; | |
$s2 = ""; | |
$s3 = ""; | |
while (#i1 < #j1) { | |
#i2 = 0; | |
#j2 = 0; | |
#j2 = dllfunc("CountCurrentHeader",$searchString[#i1]); | |
while (#i2 < #j2) { | |
$s1 = ""; | |
$s1 = dllfuncstr("CurrentHeader2",$searchString[#i1],#i2); | |
#i3 = 0; | |
#j3 = 0; | |
#j3 = dllfunc("CountEmailList",$s1); | |
while (#i3 < #j3) { | |
#j4 = 0; | |
$s2 = dllfuncstr("GetEmailList",$s1,#i3); | |
$mailList[#i4] = dllfuncstr("SetEmailOnly",$s2); | |
#j4 = strstr($mailList[#i4],"@"); | |
if (#j4 < 1) { | |
#errorFlag = 1; | |
} else { | |
$s3 = rightstr($mailList[#i4],strlen($mailList[#i4]) - #j4 - 1); | |
if ($s3 == $selfDomain) { | |
goto Skip; | |
} | |
#i5 = 0; | |
while (#i5 < #j5) { | |
if ($domainList[#i5] == $s3) { | |
goto Skip; | |
} | |
#i5 = #i5 + 1; | |
} | |
$domainList[#j5] = $s3; | |
#j5 = #j5 + 1; | |
Skip: | |
} | |
#i4 = #i4 + 1; | |
#i3 = #i3 + 1; | |
} | |
#i2 = #i2 + 1; | |
} | |
#i1 = #i1 + 1; | |
} | |
if (#errorFlag == 1) { | |
message "無効なアドレスが含まれています。"; | |
#m = dllfunc("SetCancel",1); | |
endmacro; | |
} | |
#i = 0; | |
while (#i < #i4) { | |
$messageBox = $messageBox + $mailList[#i] + "\n"; | |
#i = #i + 1; | |
} | |
#flag = dllfunc("Bypass_MessageBox",hidemaruhandle(0),$messageBox+"に送信してよろしいですか","宛先の確認",0x124); | |
if (#flag == 7) { | |
#m = dllfunc("SetCancel",1); | |
endmacro; | |
} | |
if (#j5 > 1) { | |
$messageBox = $selfDomain + "以外の\n"; | |
$messageBox = $messageBox + str(#j5) + "個のドメインがあて先に登録されています。\n\n***内訳***\n"; | |
#i = 0; | |
while (#i < #j5) { | |
$messageBox = $messageBox + $domainList[#i] + "\n"; | |
#i = #i + 1; | |
} | |
#flag = dllfunc("Bypass_MessageBox",hidemaruhandle(0),$messageBox+"送信してよろしいですか","ドメインの確認",0x124); | |
if (#flag == 7) { | |
#m = dllfunc("SetCancel",1); | |
endmacro; | |
} | |
} | |
endmacro; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks a lot!
It would be Good macro to avoid fatal trouble.