w3JMail Examples

Examples 3.7

Logging

Using the log in Dimac w3 JMail requires version 3.5.5 or later.

The log itself is a property of the w3 JMail object which you can read, thus you do NOT get a log file on your server.

   JMail.asp

<html>
<head>
<title>Confirmation </title>
<body>

<%
    Set JMail = Server.CreateObject ("JMail.SMTPMail")
    JMail.Silent = true;
    JMail.Logging = true;
    JMail.ServerAddress = "mail.yourdomain.com:25"
    JMail.Sender = "myemail@mydomain.net"
    JMail.Subject = "Here you go..."
    JMail.AddRecipient "dad@some.com"
    JMail.Body = "Here you go. Your request has been approved"
    JMail.Priority = 1

    IF NOT JMail.execute THEN
        Response.Writ e( "ERROR MESSAGE: " & JMail.ErrorMessage & "<BR>" & vbcrlf )
        Response.Writ e( "ERROR SOURCE: " & JMail.ErrorSource & "<BR>" & vbcrlf )
        Response.Writ e( "LOG: <pre>" & JMail.Log & "</pre>" & vbcrlf )
    ELSE
        Response.Writ e( "Email sent successfully!" )
    END IF

%>
</body>
</html>