Archived Forum Post

Index of archived forum posts

Question:

SMTP connect failReason2 = 7

Apr 09 '14 at 20:29

Hi,

I'm performing a Mailman.VerifySMTPConnection call, using Visual Basic 6 and the ChilKat ActiveX control for Visual Basic 6.0. The call fails but in the Mailmain last error string I can see failReason2: 7.

Can anybody tell me what this means and also where a generic list of error codes can be found for the Visual Basic 6.0 Active X component?

Here's the code snippet that fails. I've obviously removed my password.

Dim email As ChilkatEmail ' New email Dim mailman As New ChilkatMailMan ' Mail service Dim f As frmEmailErrorDetails ' For display of error logs Dim success As Long ' Return code

' Register error handler
On Error GoTo ErrorHandler

    ... etc ...

    ErrorString = "Create mail objects"

    ' Compose new objects including email message and mailman to send it
    Set f = New frmEmailErrorDetails
    Set email = New ChilkatEmail
    Set mailman = New ChilkatMailMan

    ErrorString = "Unlock mailman component"

    ' Unlock mailman component
    If (Not mailman.IsUnlocked) Then
        success = mailman.UnlockComponent("30-day trial")
        If (success <> 1) Then GoTo EmailQuoteError
    End If

    mailman.DebugLogFilePath = "c:\temp\debug.log"

    ' Clear SMTP log and enable verbose logging
    mailman.ClearSmtpSessionLog
    mailman.VerboseLogging = 1

    ' Set SMTP logon parameters
    mailman.SmtpHost = "smtp.live.com"          ' SMTP host
    mailman.SmtpUsername = "vitalida@msn.com"   ' User login name
    mailman.SmtpPassword = ""                   ' User login password
    mailman.SmtpSsl = 1                         ' Using SSL
    mailman.SmtpPort = 465                      ' SMTP port number

    ' Verify whether or not SMTP connect and login will be successful
    success = mailman.VerifySmtpConnection ' <-------- FAILS HERE --------
    If (success = 1) Then
        success = mailman.VerifySmtpLogin
        If (success <> 1) Then
            ErrorString = "VerifySmtpLogin"
        End If
    Else
        ErrorString = "VerifySmtpConnection"
    End If

    If (success = 0) Then GoTo EmailQuoteError2 ' <-------- ERROR TRAPPED HERE

Here's the debug log illustrating the error:

VerifySmtpConnection: DllDate: Mar 27 2014 ChilkatVersion: 9.5.0.23 UnlockPrefix: 30-day trial Username: DAVID-LT-I7:DAVID Architecture: Little Endian; 32-bit Language: ActiveX VerboseLogging: 1 Checking TCP/IP connectivity to the SMTP server. This does not check the login/password. Checking connectivity to SMTP server smtp.live.com:465 smtp_host: smtp.live.com smtp_port: 465 connect2: hostname: smtp.live.com port: 465 ssl: 1 connectImplicitSsl: connectSocket: domainOrIpAddress: smtp.live.com port: 465 connectTimeoutMs: 30000 connect_ipv6_or_ipv4: Multi-threaded domain to IP address resolution resolveHostname6: getAddressInfo: (leaveContext) (leaveContext) AddrInfoList: AddrInfo: ai_flags: 0 ai_family: 2 ai_socktype: 0 ai_protocol: 0 ai_addrlen: 16 ai_canonname: (NULL) (leaveContext) (leaveContext) connecting to IPV4 address... ipAddress: 65.55.96.11 createSocket: (leaveContext) connect: Waiting for the connect to complete... (leaveContext) (leaveContext) (leaveContext) pmConnect failed. (leaveContext) failReason1: 7 (leaveContext) Failed to connect to SMTP server. (leaveContext) Failed. (leaveContext)

Thank you.

David.


Answer

The failReason = 7 indicates that the connection was rejected by the server for some reason known only to the server. One example might be if the server does not like the origin of the client connecting.