|
|
|
Автоматическая(!) отправка e-mail из PB... (OutLook 2003)
|
|||
|---|---|---|---|
|
#18+
Привет всем! Такая вот проблемка небольшая - кто сталкивался - Help! --- Пользователь хочет, чтобы из скрипта PB 8.0.3 автоматически(!) сразу же отправлялось письмо с прикрепленным сформированным Word-файлом - пользователь даже не хочет входить в OutLook и нажимать кнопку "получить/отправить" - а письмо упорно не хочет отправляться и лежит в "Исходящих" (статус отправлено - нет) OutLook 2003. Вот текст скрипта: --- MailSession lms_main MailMessage lmMsg MailreturnCode li_code MailFileDescription lm_file String ls_name, ls_mail, ls_currentdir, ls_str Int li_send string as_config, as_password string as_title, as_message, as_path, as_filename ls_mail = "...." as_config = "...." // 2003 - Outlook; Microsoft Exchange Server as_password = "" as_title = "аааааааааа " + file_no1 as_message = "(autosend) Сообщение ... в прикрепленном файле..." as_path = ls_dirtemp as_filename = ls_tempfile lms_main = Create MailSession li_code = lms_main.mailLogon(as_config, as_password, mailNewSession!) If li_code <> MailReturnSuccess! Then Messagebox('Ошибка!',"....") goto label_con2 End If lmMsg.Subject = Trim(as_title) lmMsg.NoteText = Trim(as_message) If (IsNull(as_filename) Or as_filename = '') Or (IsNull(as_path) Or as_path = '') Then Else // если указано имя файла и путь lm_file.FileType = mailAttach! lm_file.Filename = as_filename lm_file.Pathname = as_path + '\' + as_filename lmMsg.AttachmentFile[1] = lm_file End If lmMsg.Recipient[1].name = ls_mail li_code = lms_main.mailSend( lmMsg ) If li_code <> MailReturnSuccess! Then Messagebox('Ошибка!', "....") End If lms_main.mailLogoff( ) label_con2: Destroy lms_main --- Можно ли и как все-таки решить с автоматической отправкой? Или это что-то в настройках OutLook 2003? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 29.06.2005, 10:58 |
|
||
|
Автоматическая(!) отправка e-mail из PB... (OutLook 2003)
|
|||
|---|---|---|---|
|
#18+
Это что-то в настройках именно Outlook 2003. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 29.06.2005, 11:42 |
|
||
|
Автоматическая(!) отправка e-mail из PB... (OutLook 2003)
|
|||
|---|---|---|---|
|
#18+
Хм-м, а что... в OutLook-е?... Немедленная отправка там (Параметры/Настройка почты) стоит... ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 29.06.2005, 12:04 |
|
||
|
Автоматическая(!) отправка e-mail из PB... (OutLook 2003)
|
|||
|---|---|---|---|
|
#18+
Хм-м еще раз, почитал поиском найденное (по сабжу)... Оказывается - в OutLook 2003 автоматическая отправка - неразрешимая проблема (сразу в отправленные никак не пропихнуться)... --- в outlook express - все ok, но это не наш корпоротивный стандарт... :( надо именно - OutLook 2003 --- Help! вдруг кто-то как-то обходит это.... пользователи хотят автоматически... ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 15.07.2005, 11:45 |
|
||
|
Автоматическая(!) отправка e-mail из PB... (OutLook 2003)
|
|||
|---|---|---|---|
|
#18+
предлагаю отправлять по SMTP можно с помощью PBNI расширения - есть на codexchange можно с помощью blat.dll - сам пользуюсь иначе будете от версии к версии иметь траблы с аутглюком единственный недостаток - не сохраняются отправленные письма можно предлагать отправку на выбор пользователя, см. скриншот по сабжу: возможно надо чтобы Outlook 2003 был уже запущен в Outlook XP у меня отправляет сразу в любом состоянии ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 15.07.2005, 12:24 |
|
||
|
Автоматическая(!) отправка e-mail из PB... (OutLook 2003)
|
|||
|---|---|---|---|
|
#18+
Спасибо, rcryo!!!! попробую... сохранять и не требуется... а эти действия обязательны? :)) - 1) Copy the file "Blat.exe" to your "\WINNT\SYSTEM32" directory, or to any other directory in your path. 2) Optionaly, run "Blat -install smtp.yoursite.tld youruserid@yoursite.tld из readme: DESCRIPTION: Blat is a Public Domain (generous aren't we?) Win32 console utility that sends the contents of a file in an e-mail message using the SMTP protocol. Blat is useful for creating scripts where mail has to be sent automatically (CGI, backups, etc.) To use Blat you must have access to a SMTP server via TCP-IP. Blat can store various default settings in the registry. The command line options override the registry settings. Input from the console (STDIN) can be used instead of a disk file (if the special filename '-' is specified). Blat can also "carbon copy" and "blind carbon copy" the message. Impersonation can be done with the -i flag which puts the value specified in the "From:" line, however when this is done the real senders address is stamped in the "Reply-To:" and "Sender:" lines. This feature can be useful when using the program to send messages from users that are not registered on the SMTP host. Optionally, Blat can also attach multiple files to your message. INSTALLATION: If you are upgrading from version 1.2 or later, simply copy Blat.exe over the old one. Blat no longer needs gensock.dll or gwinsock.dll. You can delete these unless another application you use requires them. If you are upgrading from Blat 1.1 or 1.0 (phew!) or you never used Blat before you can follow these steps: 1) Copy the file "Blat.exe" to your "\WINNT\SYSTEM32" directory, or to any other directory in your path. 2) Optionaly, run "Blat -install smtp.yoursite.tld youruserid@yoursite.tld" ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 15.07.2005, 12:50 |
|
||
|
Автоматическая(!) отправка e-mail из PB... (OutLook 2003)
|
|||
|---|---|---|---|
|
#18+
автор1) Copy the file "Blat.exe" to your "\WINNT\SYSTEM32" directory, or to any other directory in your path. blat.exe может находится в папке с программой, можно и не blat.exe а blat.dll автор2) Optionaly, run "Blat -install smtp.yoursite.tld youruserid@yoursite.tldКлючевое слово Optionaly. Если указывать в строке параметров отправки сообщения адрес smtp сервера и свой обратный адрес то инсталировать не надо. Инсталяция нужна только для сохранения в реестре этих значений по умолчанию. Рекомендую все параметры подключения к smtp серверу передавать каждый раз при отправке сообщения и дать возможность продвинутому пользователю их менять ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 15.07.2005, 13:22 |
|
||
|
Автоматическая(!) отправка e-mail из PB... (OutLook 2003)
|
|||
|---|---|---|---|
|
#18+
>> lmMsg.AttachmentFile[1] = lm_file попробуй lmMsg.AttachmentFile[-1] = lm_file >> lmMsg.Recipient[1].name = ls_mail а после попробуй resolve адрес если не получится я посмотрю исходники - у меня все прекрасно работает но написано на PB 6.51 ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 27.07.2005, 17:31 |
|
||
|
Автоматическая(!) отправка e-mail из PB... (OutLook 2003)
|
|||
|---|---|---|---|
|
#18+
в умной книге написано строковой переменной адреса достаточно для пользователей в локальных почтовых системах, но если почта посылается через почтовые шлюзы , то необходимо передать полное описание адреса в структуре mailRecipient. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 28.07.2005, 08:58 |
|
||
|
Автоматическая(!) отправка e-mail из PB... (OutLook 2003)
|
|||
|---|---|---|---|
|
#18+
Thank. >>lmMsg.AttachmentFile[-1] = lm_file не прошло - вообще не отправляет... и физический смысл непонятен? :) >>resolve адрес >>полное описание адреса в структуре mailRecipient например, как выглядет? примерчик бы... ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 29.07.2005, 16:19 |
|
||
|
Автоматическая(!) отправка e-mail из PB... (OutLook 2003)
|
|||
|---|---|---|---|
|
#18+
реальный правда сильно урезанный кусок кода mailmessage tmpmail,mailtemplate mailrecipient tmprec mailreturncode mailerr mailfiledescription mailfile,tmpfile long i4 // my_session - сессия соединения // список получателей в trec string trec // создаем письмо tmpmail=mailtemplate for i4=1 to numtoken(trec,";") if alltrim(token(trec,";",i4))<>"" then tmprec.name=alltrim(token(trec,";",i4)) // проверить на существование получателя mailerr=my_session.mailresolverecipient(tmprec) if mailerr=mailReturnSuccess! then tmprec.recipienttype=mailTo! tmpmail.recipient[i4]=tmprec elseif mailerr=mailReturnFailure! then elseif mailerr=mailReturnInsufficientMemory! then elseif mailerr=mailReturnUserAbort! then end if end if next // добавляем файлы // path[] - путь к файлу // files[] - имена файлов i44=numtoken(tmp_email.object.file[i1],";") i8=1 for i41=1 to i44 mailfile.filetype=mailAttach! mailfile.pathname=path[i41]+files[i41] mailfile.filename=files[i41] // прикрепляем файл mailfile.position=-1 tmpmail.attachmentfile[i8]=mailfile i8++ next // задаем тему tmpmail.subject=alltrim(tsubject) // добавляем подпись tmpmail.NoteText+=.......... // устанавливаем флаг подтверждение прочтения tmpmail.ReceiptRequested=true // отсылаем письмо my_session.mailsend(tmpmail) ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 01.08.2005, 12:09 |
|
||
|
|

start [/forum/topic.php?fid=15&msg=33168324&tid=1338225]: |
0ms |
get settings: |
9ms |
get forum list: |
19ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
51ms |
get topic data: |
11ms |
get forum data: |
2ms |
get page messages: |
62ms |
get tp. blocked users: |
2ms |
| others: | 228ms |
| total: | 392ms |

| 0 / 0 |
