Авторские разработки С++ MFC

О проекте | Новости | Статьи | Исх.тексты | Отзывы | Форум | Главная

SendMail

arrow1.gif (529 bytes)About
arrow1.gif (529 bytes)Setup
arrow1.gif (529 bytes)Licens(Russian)
arrow1.gif (529 bytes)Features
arrow1.gif (529 bytes)FAQ
arrow1.gif (529 bytes)Description

Description

This program was made for command prompt only working

Run:

sendmail.exe <smtp.server> <address>/<address>=<address> <file>/<dir>

Example:

sendmail.exe mail.ru mail@mail.ru tmp.txt

If you run this program without parameters or with /? parameter you can see a description screen.

<smtp.server> - your outgoing mail server (ask your Internet provider). Usually it is the SMTP server of your network. If you don't know it address you can use SMTP server of your receiver. For example, if a receiver is ivanov@microsoft.com that if will be the microsoft.com.

Note: In some case SMTP servers can't receive a message from a not known user.

<address>/<address>=<address> -address for mail receiver, for example ivanov@microsoft.com. You can set a sender address throw command prompt if you type = and address. For example ivanov@microsoft.com=petrov@mail.ru, in this case a senders address from template or initialization file will be ignored.

<file>/<dir> - file list divided a space symbol that you want to send. You can send all file from a folder an subfolder. If you set a folder that you must type back slash after folders name. For example c:\out\

Note: If you want to send a file with a long name you must send it from a folder

Initialization file.

For advanced settings you can use an initialization file (sendmail.ini). It must located in sendmail folder. It is a simple text file and you can edit it by any text editor.

Parts of initialization file

[Setting] - it part for common settings

[Mail] - it part for message settings

[Auth] - it part for authorization settings

Setting part.

Port=PORT_NUMBER, default is 25, it parameter for set up non default port of network socket.

DeleteSendedFile=ON/OFF, default is ON. if ON that after success sending file it file will be deleted.

FileProtocol=FILE_NAME, default is SENDMAIL.TXT. Set of protocol file name.

Protocol=ON/OFF , default is OFF. If ON that protocol will be deleted.

AddProtocol=ON/OFF, default is OFF. If ON that protocol will be added.

WakeUp=MM:HH, default is current time. Permit to put off run this program till appointed time.

Delay=SECONDS, default is 0. Set up seconds that sendmail will wait till next try after fail connect.

DelaySend=MINUTES, default is 0. Delaying time between sending messages if set Multi=ON

Try=NUMBER, default is -1. How many times Sendmail must to try to connect. -1 is to try infinity time (user can break this process).

Note. If it is equal zero that SendMail don't to try to connect.

Phone=NUMBER, default is empty. It is a phone for Dial Up connection.

Dial=NAME_OF_RAS_DIAL_CONNECTION, default is empty. The name of RasDialConnection for connect.

Note: if is not empty then Phone parameters will be ignored.

User=NAME_OF_USER, default is empty. If Phone or Dial isn't empty then it is set the name of user for connect with your Internet provider.

Pass=PASSWORD, default is empty. If Phone or Dial isn't empty then it is set the password for connect with your Internet provider.

Note. If you set up scenario file with your Dial Up Connection where are your username and password you can remain Pass and User empty.

Mail part

From=ADDRESS_FROM, default is NotForMail@hackzone.ru. This is parameter for set address of mail receiver. You must set this parameter if you want that receiver can reply message, otherwise some SMTP server can deny the access.

Note. If Templ parameter is not empty that address will be taken from template and parameter From will be ignored. If your command prompt include address of sender that this parameter will be ignored too.

Multi=ON/OFF default is OFF. For sending each file by individual post message. Recommended for sending archive volume.

Templ=TEMPLATE_FILE default is off. You can save the letter to .EML file and set it as template. You can make message with your own text in HTML or simple text format and all files will be attached to this template. If you don't set Teml parameter, that the message will contain internal Sendmail advertisement.

Auth part

Auth=TYPE default is empty. For simple authorization you must set LOGIN

Login=USER_NAME for authorization

Password=PASSWORD password for authorization.

Attention! If your server don't support this authorization you can see next error.

502 Error: command not implemented

ERRORLEVEL

0 - success

1- one or more file(s) is not found

2- process was broken by user or Try count was complete.

Example:

@echo off
start /w sendmail.exe server ivanov@mail.ru file.txt
if errorlevel 2 goto break
if errorlevel 1 goto error
echo success
goto end
:error
echo file is not found
goto end
:break
echo program was broken
goto end
:end

Download:  sendmail.zip     (150 Kb)

© Авторские разработки http://progcpp.narod.ru при цитировании ссылка обязательна.

Сайт создан в системе uCoz