Как программно отправить письмо с файлом из 1с через TheBat. #19953


#0 by Генс
Как программно отправить письмо с файлом из 1с через TheBat. Приму любые примеры.
#1 by Diter
Архиватор WinRAR имеет ключик хитрый, который позволяет после упаковки файла отправить его по e-mail через штатный почтовый менеджер (который по умолчанию в Windows стоит).
#2 by Diter
(+1) А упаковать файл этим архиватором можно вызвав его и передав нужные параметры из 1С.
#3 by dfgrg
где то статья была про организацию почтовых рассылок через TheBat - правда я ее не читал. может то а может и нет. А когда сам пробовал - ничего толком не получилось - у меня пара ящиков и он требовал ввода пароля. В итоге написал на Delphi отправку через SMTP  вначале просто прогу , потом и внешнюю компоненту. год уже работает... Правда 98 винда не загружала внешнюю компоненту через сеть, приходилось ее вначале копировать на локальный комп. или 2000 -я - не помню
#4 by miki
Вот тебе две идеи, может слепишь чё-нить. 1. ЗапуститьПриложение("mailto:bla_bla@mail.ru"); - если у тебя мышь почтовый клиент по-дефолту, то запустит его и промишет адрес. 2. ЗапуститьПриложение("c:Program FilesThe Bat! hebat.exe C:failo.zip"); - откроет мышь и приаттачет к нему "C:failo.zip". Подозреваю, что в 1. можно еще параметры прописать (subj, attach), но пока не знаю как.
#5 by miki
Попробуй прочесть это: The /MAIL command is used for automated message creation using a template, text file and/or set of attached files for a specific destination address. This command is extremely useful for applications that need to send e-mail messages without having to do the additional work involved in the implementation of the various Internet email standards. The syntax of the /MAIL command is: /MAIL[parameter1[;parameter2[;parameter3[...]]] Possible parameters are (a parameter may be identified by two or more names): USER=value or U=value    value is the name of the source account. If no FOLDER parameter is specified, the target folder will be the Inbox of the given account. PASSWORD=value or P=value    value is the password which will unlock the account if it is needed. FOLDER=value or F=value    value is the target folder's pathname. If the pathname does not include an account name, The Bat! will search all accounts for a folder with a matching name; the first folder found will be used as the target folder. If the specified folder is not found, the Outbox folder of the target account is used. TEMPLATE=value or T=value    value is the pathname of the file which contains the template that will be used for the creation of the message. By default, it is the standard template of the target folder or the target account. TO=value    value specifies the primary addressee of the message. You can add additional addressees using template macros %TO, %CC, %BCC. SUBJECT=value or S=value    value specifies the subject of the message. It is also possible to define the message subject in the template using %SUBJECT macros. TEXT=value or  CONTENTS=value or C=value    value is the pathname of a plain text file which contains the text of the message. It is also possible to include a text file into a message using the %PUT macro in the template. ATTACH=value or  FILE=value or A=value    value is the pathname of the file which will be attached to the message. It is also possible to use %ATTACHFILE macros in the template. SEND    if this parameter is used, the created message will be sent out as soon as it has been created. QUEUE    if this parameter is used, the created message will be queued in the Outbox once it is created. EDIT    if this parameter is used, The Bat! opens the editor with the message created using the parameters from above Examples of the /MAIL command: /MAILU=MyAccount;TO=some@address.com;S=Test;TEXT=C:TESTsTEST.MSG /MAILF=\MyAccountTest;TO=some@address.com Notes: ·    To separate parameters, use semicolons (";" characters). Do not put spaces between parameters when using the  /EXPORT command from the command line because a space-separated mask will be interpreted as the next command line parameter and will not be processed as intended.     ·    If a parameter value contains space characters, enclose it in quotation marks. If a value contains quotation marks, you should use single quotes (" ' " characters).
#6 by Генс
большое спасибо то что надо.
#7 by Бивень
Протокол mailto не поддерживает аттач ...
#8 by miki
Спасибо скажи Композитор'у: Я просто параметр другой притулил
#9 by miki
Заодно и др. по-русски:
Тэги:
Ответить:
Комментарии доступны только авторизированным пользователям

В этой группе 1С