Send properly-formatted SMTP email with no ASP programming!
No need to bother with programming any of the the SMTP/ESMTP protocol details!
Overview
GWXMail is a server-side Active X component that interfaces with
GWMail32 to let you send SMTP mail
directly from your ASP web pages.
GWXMail DLL handles all the complexity of Winsock communications and the SMTP/ESMTP protocols.
Greyware Mail DLL is designed to be as bullet-proof and easy-to-use as possible. It uses
intelligent defaults, and provides clear plain-English error messages.
Requirements
GWXMail is only supported on NT 4.x or NT 5.x, running Microsoft's IIS
version 4.0 or later.
GWXMail is a standard Active X component, so can be called from VB,
Visual C/C++, or any other development environment that supports
Active X. Only support for calling GWXMail from an ASP page is
documented.
Setup and Installation
Copy gwxmail.dll to the system32 directory (usually C:\WINNT\SYSTEM32)
of your web server. Click Start, then choose Run. On the Open
line, type regsvr32 c:\winnt\system32\gwxmail.dll and click OK.
If gwmail32.dll is not already on the web server, copy it to the system32
directory, too. You do not need to run regsvr32 for gwmail32.dll.
If you have trouble registering GWXMail, check our
online knowledgebase
for tips.
Version History
1.0.b.981028 - fixed bug in WriteLine property that sometimes
caused premature truncation of the message buffer
1.0.b.981013 - initial public release
1.0.b.980920 - beta test release
Notes
GWXMail is easy to use. To show you just how easy, here's a sample
ASP file that sends an email:
<%
Set Mailer = Server.CreateObject("GWXMail.Mailer")
Mailer.Clear
Mailer.SMTPHost = "127.0.0.1;smtp.greyware.com"
Mailer.AddrTo = "sales@greyware.com, info@greyware.com"
Mailer.From = "Jeffry Dwight <jeffryd@greyware.com>"
Mailer.Subject = "Test of GWXMail"
Mailer.Message = "Hi. Just testing GWXMail. Pretty easy, huh?"
Mailer.Send
If Mailer.Error then
Response.Write "Oops! " & Mailer.ErrorMessage
Else
Response.Write "Cool! " & Mailer.Subject & " was sent "
Response.Write "using " & Mailer.SMTPHost & "."
End If
Set Mailer = Nothing
%>
As this example shows, email addresses can be either standard format
(as shown in the AddrTo line above) or include a friendly name (as shown
in the From line above). The portion of
the address containing the @ sign is used when actually sending the
email; the whole address, however you specify it, is sent with the
extra headers.
You may include multiple recipients in the AddrTo, CC, or BCC statements,
provided that you separate the recipients with a comma (as shown in the
AddrTo line of the example above).
This example also shows that most of the properties are read/write, meaning that
your code can both set the properties with an assignment statement (writing, as
shown in the Mailer.AddrTo = line), or refer to the current value (reading,
as shown in the Response.Write lines).
Methods
The following methods are supported by the GWXMail.Mailer object:
Clear
Resets all parameters to their defaults and clears the message buffer.
Send
Sends the message buffer, plus any attachments. Check the Error property after using the Send method to determine whether or not your mail was sent successfully.
Properties
The following properties are supported by the GWXMail.Mailer object:
AddrTo
read write
Required. Sets or returns the name(s) of the recipient(s).
BCC
read write
Optional. Sets or returns the name(s) of the BCC recipient(s).
CC
read write
Optional. Sets or returns the name(s) of the CC recipient(s).
Encoding
read write
Optional. Sets or returns an integer representing the encoding method to use for the attached file. Default is ENCODING_AUTO.
Error
read only
Returns a long indicating the last error encountered (zero means no error).
ErrorMessage
read only
Returns a textual description of the last error encountered.
ErrorsTo
read write
Optional. Sets or returns the email address for the ErrorsTo header.
Filename
read write
Required if sending a file. Sets or returns the path and name of a file to attach.
From
read write
Required. Sets or returns the name of the sender.
Message
read write
Required for email without an attachment, unless message buffer set with WriteChars or WriteLine. Sets or returns the contents of the message buffer. Note, setting this property will overwrite anything already in the message buffer, including text placed there with WriteChars or WriteLine.
ReplyTo
read write
Optional. Sets or returns the email address for the ReplyTo header.
SMTPHost
read write
Required. Sets or returns the name or IP address (specified as a string) of the SMTPHost to use.
Subject
read write
Optional. Sets or returns the email's subject.
UseDOSName
read write
Optional. Sets or returns a Boolean value controlling whether to generate a short file name for the attached file. Default is FALSE.
Version
read only
Returns a string indicating the GWXMail version.
WriteChars
write only
Optional. Appends text to the message buffer.
WriteLine
write only
Optional. Appends text plus a CRLF to the message buffer.
Constants
The following constants are used with GWXMail. In your code, you may
either define the constants and then use their names (recommended), or
use the numeric values directly.
ENCODING_AUTO = 0 ' to let DLL determine encoding
ENCODING_DEFAULT = 0 ' synonym
ENCODING_TEXT = 1 ' to force plain text (no encoding)
ENCODING_UUENCODE = 2 ' to force UUENCODE
ENCODING_BASE64 = 3 ' to force MIME Base64 encoding
ENCODING_MIME = 3 ' synonym
If ENCODING_AUTO is used (default), GWXMail will determine whether or not
the attached file needs to be encoded. If the file appears to be text,
GWXMail will incorporate it into the body of the letter, after anything
that may be in the message buffer. (If you are attaching a file, you are
not required to set the Message property.)
Any other encoding method forces GWXMail to use that method, no matter
what the contents of the file may be.