wSendmail  Documentation
wSendmail 1.3 for Win95/NT

wSendmail  is a handy utility for sending emails from programs, the command-line or directly from HTML Forms on Windows based systems (Win95 and NT). I wrote the program in order to implement a mail-response feature on a WEB service. It appears that most pearl scripts and .c CGI programs are written for UNIX systems and depend on the UNIX sendmail program to work. I don't have the man file for UNIX sendmail, so wSendmail is not comforming to the UNIX line syntax. The program is first of all a CGI-BIN utility for mail-response. 

In CGI mode, it must run as a standard CGI-BIN app, and not as WIN-CGI! (If I have got it right, WIN-CGI is a interface to get around limitations in Visual Basic. wSendmail is written in c++).

wSendmail  is released as "freeware" under the following conditions:

•	You might not charge anything for the distribution of this software, but the actual costs of media, shipping etc. 
	
•	This software comes without any guarantee of any kind. The author  TAKE  NO RESPONSIBILITY FOR ANY DAMAGE, LOSS OF INCOME, OR ANY OTHER PROBLEMS YOU MIGHT EXPERIENCE FROM USING THIS SOFTWARE. 
	
•	This software is NOT TO BE USED by any governmental or mainstream political institutions in any country. The freeware policy does ONLY apply for private individuals and private corporations. The governmental and mainstream political organizations can go and get their software somewhere else. Universities, schools and other public educational institutions can use this software as they wish. 
	
•	Jarle Aase keeps the full Copyright of all this software and documentation, and reserves the right to change this policy at any time.

The first time the program is started it will create a wsendmail.ini file in your Windows directory. This file must be edited so that the program knows the address (domain name - not IP number) of your SMTP server, the default return path and the nicknames of all receivers of email when it is used as a CGI-BIN app.

Below is the syntax if you use the program from the DOS command line:

wSendmail [-debug] [-verbose] [-mime] [-sSubject] [-fFrom] {to[,to] | @addr_list_file} mail_file
wSendmail [-debug] [-verbose] [-mime] [-sSubject] [-fFrom] {to[,to] | @addr_list_file} < message
Example:
	wSendmail -v "-sTest message" -fme@somewhere.com someone@somewhere.com
	(Since no mail_file is given, you must type in the message body from the keyboard)

Line parameters are not used when running as CGI-BIN app.

The parameters in is square brackets are optional.

	-debug enables logging of the mail transaction. 
	-verbose enables logging of the result of the transaction
	-s specifies the subject of the message. 
	-f identifies the sender of the mail.
	-mime disables mime encoding

If you use the program as a CGI-BIN app, copy it to your CGI-BIN directory and call it from your HTML Forms. A sample page is included with this distribution.

 If used as a CGI-BIN app, the following fields are required:

•	"from" = senders email address (will map to "someone@somewhere.com" if not filled in
	
•	"RCPT" = Receiver of the email. There can me any number of receivers. This field will typically be hidden. The data value of this filed is a nickname defined in the wsendmail.ini file in your windows directory. This way mail can only be sent to mailboxes authorized by you. 
	
•	"subject" = The subject field in the email. Typically used to  identify the page HTTP that generated the email.

Any other form fields will be included in the message body with the filed name as a header, and the contents following on the next line. This version supports a total of  500 fields.

Note that the filed labels are case sensitive.

The program supports mime 1.0 encoding of European national characters.
It also applies to the RFC 821 and RFC 822 specs.33999
In CGI-BIN mode the program supports any number of recipients. In command line mode you can specify multiple recipients by separating them with comma (jgaa@online.no,whoever@somewhere.com) or by replacing the to parameter with a "@filename". The @ tells wSendmail that the recipients are in the filename. The recipients file is a standard ASCII file with one email address on each line.

The program will automatically detect if it is started by a HTTP server as a CGI-BIN app, and output a confirmation page in standard HTML 1 format. The HTML code is defined in the "wSendmail.ini" file, and can be modified to suit your needs.

wSendmail.ini

The wSendmail.ini file is located in your Windows directory. It is created and configures with default values the first time the program is started. You must configure this file before wSendmail will work.

The following is a description of the fields in the .ini file:

[wSendmail]

; The SMTP host where wSendmail will post emails
; This field *must* be configured with your SMTP host
SMTP Host=mail.online.no

; The default return path
; Put your email POP3 account here
Return Path=jgaa@online.no

; Shall wSendmail delete the message body file?
; Applies only when running in command line mode
Delete File When Used=No

; The HTML code used in the header. Must be less than 127 characters.
HTML Head=<html><body><H1>Mail Confirmation</H1><hr><p>
HTML OK=<h4>Message sent.</h4></body></html>
HTML Fail=<H3>Error %d %s.<br> Message could not be forwarded</h3></body></html>

; Allow real email addresses to be used in forms?
; If not, the forms must use a nickname from the [Nicknames] section below
Restrict Email=No

; Use Microsoft Internet Information Server HTTP header?
; If your server complains about the header, change this to Yes or No.
IIS header=Yes

; Enable MIME character encoding?
Mime Encoding=Yes

; Valid nicknames. The nickname is used in the HTML form and referrers to a
; email address. 
[Nicknames]

jgaa=jgaa@jgaa.ldp.no
jgaa-at-telepost=jgaa@telepost.no
jgaa-test=jgaatest@ldp.no
jgaatest=jgaatest@ldp.no

Trouble shooting.

If you have trouble getting the program to work, run it from the command line with the -debug flag. This will allow you to monitor the communication between the SMTP server and wSendmail.

	wSendmail -debug -ttest Your.Email@wherever.com

Support is not available. But please report bugs.

If I make new versions, they will appear on the programs homepage, in the "Jgaa's freeware" section of 
	
	http://home.sol.no/jgaa/