Note about FromAddress: You must specify a value for the FromAddress property. Mail failure will occur without a FromAddress.
If the component can determine why the SendMail method failed, that information will be stored in the Response property. So, for example, to print that information to the clients browser you could add the following code:
if not Mailer.SendMail
then
if Mailer.Response <> ''" then
strError = Mailer.Response
else
strError = "Unknown"
end if
Response.Write "Mail failure occured. Reason: " & strError
end if
Another fairly common problem is when a user reports that a specific feature is not working. For example BCC's may seem to never reach their destination. A valuable debugging tool is available with the SMTPLog feature. Assign a valid filename to this property and the contents of the SMTP transaction that occurs during a SendMail call will be recorded to this file. If you find that the SMTP transaction occurs without error then you should check elsewhere for the cause of mail delivery failure. Invariably the user finds that the BCC address was invalid or that the address was misconfigured. The SMTPLog feature allows you to verify if the transactions are complete and valid before pursuing other avenues in determining the cause of failure.
Reasons for operation timed out include:
AddRecipient, AddCC and AddBCC work just as they should. The problem is not with ASPMail. It is likely that your SMTP server is rejecting "foreign addresses" (see "no relay" question below).
To test whether ASPMail is functioning properly use the SMTPLog property to capture an SMTP session with multiple recipients. All the recipients you send to should appear in the log as the SMTP envelope is sent. If they all appear then the problem is with your SMTP server or an SMTP server down the stream (or your addresses are invalid).
Under VBScript you can use the predefined constant VbCrLf. Simply using a Chr(13) or a Chr(10) will not work --you must use both -- the VBCrLf defined constant is the preferred method. A Carriage-return and line-feed character are required to create a new line in the message. See the sample scripts for examples.
Standard SMTP does not use a uid/pwd so it isn't needed. The protocol used to retrieve mail, POP3 typically requires a uid/pwd but ASPMail doesn't use POP3 since it is a send mail component.
AOL will not accept anything other than a true address in the "From:" heading. Just about every mail system out there, except AOL and Compuserve, will accept the "No Mail Address" as the "From:" header. (thanks to R.S for this info).
ASPMail supports any 8 bit characters but please note:
Yes, the text will be appended to the message. Use ClearBodyText if you need to clear the message text.
ASPMail is a server-side component. Retrieving files from the client computer requires a client-side component that has access to the client's local harddisk or a browser that supports file uploads in addition to a server side component/extension that can accept those files. ASPMail does not support this function.
The SMTP server is looking at your FromAddress and determining that it doesn't know who you are. Some SMTP servers are configured to disallow the "relaying" or transfer of mail originating from addresses outside of its own domain. The only solution is to provide a FromAddress that's local to the SMTP server's domain or get the operator of the SMTP server to allow the FromAddress you are using. This setting is commonly used by ISP's to prevent spammers from using their resources.
ASPMail can encode high
characters using a scheme where the = sign
indicates a character to be decoded follow by the hex string value of
the character to be encoded. This system of course assumes that the client can
decode these characters (which most can). This is called quoted-printable
encoding. The default for ASPMail is not to use QP encoding. Things that trigger
automatic QP encoding:
Most clients are capable of handling QP encoding. If your client is not capable then you should upgrade your client or you must work within the above limitations to prevent the QP encoding from occuring.