
|
email this FAQ to a colleague
Q:
How do I determine a cause of mail failure?
A:
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.
- Stephen Genusa
|