Total Commander Forum Index Total Commander
Форум поддержки пользователей Total Commander
Сайты: Все о Total Commander | Totalcmd.net | Ghisler.com | RU.TCKB
 
 RulesRules   SearchSearch   FAQFAQ   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Single Post  Topic: Как быстро отправить файл по почте? 
Author Message
Сергеич



PostPosted: Mon Feb 21, 2005 21:44    Post subject: Reply with quote

Читать хелп про командную строку TheBat.

Там по поводу этого полная свобода и много возможностей.
И отсылка, и шаблоны и аттачи и дофига разного.
И настраивается по вкусу.

вот например пример скрипта:
Quote:

'=========================================================
acc_name="AMail" 'название аккаунта
fld_name="Outbox" 'название папки
subj = "Пересылаю файлы" 'заголовок сообщения
tpl_file="c:\_aff_\TheBat\att.tpl" 'имя шаблона
need_pack=1 'Установите: 0 - не надо паковать, 1 - упаковать РАРом
email = "" 'Установите: "" - спросить email, любое другое - внести email автоматом
rar_exe = "C:\APack\WinRAR\Rar.exe"
'=========================================================

set WSHShell = WScript.CreateObject("WScript.Shell")
tb_exe = WSHShell.RegRead("HKCU\Software\RIT\The Bat!\EXE path")

Command = tb_exe & " /MAILU=" & acc_name & ";F=" & fld_name & ";S=""" & subj & """;"

if email = "" then
email = InputBox("Введите Email")
Command = Command & "TO=""" & email & """;"
else
Command = Command & "TO=""" & email & """;"
end if


set fso = WScript.CreateObject("Scripting.FileSystemObject")
set file = fso.OpenTextFile(fso.GetSpecialFolder(2).Path & "\tb_files_to_send.txt", 2, true)
set Args = Wscript.Arguments

if need_pack=1 then
arc_file = fso.GetSpecialFolder(2).Path & "\files.rar"
if fso.FileExists(arc_file) then
fso.DeleteFile(arc_file)
end if

pack_command = rar_exe & " a " & arc_file
for i=0 to args.count-1
pack_command = pack_command & " """ & args(i) & """"
next
file.WriteLine "files.rar"
for i=0 to args.count-1
file.WriteLine "- " & args(i)
next

WSHShell.Run pack_command, 1, true
command = command & "A=""" & fso.GetSpecialFolder(2).Path & "\files.rar" & """;"

else
for i=0 to args.count-1
command = command & "A=""" & args(i) & """;"
file.WriteLine args(i)
next
end if

Command = command & "T=""" & tpl_file & """;"

WSHShell.Run command, 1, false
View user's profile Send private message


Powered by phpBB © 2001, 2005 phpBB Group