SMTP Send Mail Interrogation

Version 2

     

    Script

     

    Compatibility
    Creator
    Mac OS X, Windows
    Lee Lukehart
    FMP 10, 11
    SavvyData
    Web: No
    File Type: FP7
    Server: Yes
    FileSize: ~ .24 megabytes
    http://www.savvydata.com/

    Description

    This script helps streamline the process of finding SMTP settings that work. It attempts to send email using every combination of the test settings you provide, and reports on which combinations were successful. No schema edits are necessary; just paste in the script, choose your test parameters by editing the clearly marked Set Variable steps, and run the script. You may be just seconds away from solving your error 1501 – 1507 troubles!

     


    Code

    Example of configuring test parameters: the script step that sets which SMTP Ports to try:

     

    Set Variable [$vList_Ports; Value:

    "25" & "¶" & //standard SMTP port

    "587" & "¶" & //common alternative SMTP port, unsecured or TLS

    "465" & "¶" & //legacy secure SMTP (SSL)

     

    "23" & "¶" & //alternative to port 25 (Telnet)

    "26" & "¶" & //alternative to port 25

    "225" & "¶" & //alternative to port 25

    "2525" & "¶" & //alternative to port 25

    "5190" & "¶" & //alternative to port 25

    "7026" & "¶" & //alternative to port 25

    "8025" & "¶" & //alternative to port 25

     

    "110" & "¶" & //standard POP3 port; sometimes also used for SMTP

    "995" //standard POP3s (secure) port; sometimes also used for SMTP

    ]

     

    The script is thoroughly commented.

     

    Sample Input

    Sample Output

    Set Variable [$vList_Ports; Value:

    "25" & "¶" & //standard SMTP port

    "587" & "¶" & //common alternative SMTP port, unsecured or TLS

    "465" & "¶" & //legacy secure SMTP (SSL)

     

    "23" & "¶" & //alternative to port 25 (Telnet)

    "26" & "¶" & //alternative to port 25

    "225" & "¶" & //alternative to port 25

    "2525" & "¶" & //alternative to port 25

    "5190" & "¶" & //alternative to port 25

    "7026" & "¶" & //alternative to port 25

    "8025" & "¶" & //alternative to port 25

     

    "110" & "¶" & //standard POP3 port; sometimes also used for SMTP

    "995" //standard POP3s (secure) port; sometimes also used for SMTP

    ]


    Elapsed time: 0:01:06

     

    Out of 288 iterations,

    285 failed and 3 succeeded.

     

    Successful Configurations:

    =============================

    Mail_FromName: Developer

    Mail_FromEmail: sender@domain.com

    Mail_ReplyTo: sender@domain.com

    SMTP_Server: smtp.domain.com

    SMTP_Port: 25

    SMTP_SSL: OFF

    SMTP_AuthType: Plain Password

    SMTP_UserName: as set in script

    SMTP_Password: as set in script

    -----------------------------------

    Mail_FromName: Developer

    Mail_FromEmail: sender@domain.com

    Mail_ReplyTo: sender@domain.com

    SMTP_Server: smtp.domain.com

    SMTP_Port: 26

    SMTP_SSL: OFF

    SMTP_AuthType: Plain Password

    SMTP_UserName: as set in script

    SMTP_Password: as set in script

    -----------------------------------

    Mail_FromName: Developer

    Mail_FromEmail: sender@domain.com

    Mail_ReplyTo: sender@domain.com

    SMTP_Server: smtp.domain.com

    SMTP_Port: 465

    SMTP_SSL: ON

    SMTP_AuthType: Plain Password

    SMTP_UserName: as set in script

    SMTP_Password: as set in script

    -----------------------------------

     

    Unsuccessful count by Error#:

    =============================

    Error# 1501: 0

    Error# 1502: 258

    Error# 1503: 9

    Error# 1504: 0

    Error# 1505: 0

    Error# 1506: 18

    Error# 1507: 0

    Other (not tracked): 0

     

    Error# Legend:

    -----------------------------------

    1501 SMTP authentication failed

    1502 Connection refused by SMTP server

    1503 Error with SSL

    1504 SMTP server requires the connection to be encrypted

    1505 Specified authentication is not supported by SMTP server

    1506 Email(s) could not be sent successfully

    1507 Unable to log in to the SMTP server

     


    Developer's Notes

     

    Note: A puzzling cause of the 1506 error is related to the format of the email address given to the To: parameter, when you try to include the recipient’s name along with the address.

     

    Specifically, it cannot be in the most common form that uses angle brackets around the address: Full Name =BAD. The angle brackets will be rejected by most SMTP servers.

     

    Recommended best practice: use the alternative form that places parentheses around the name, as so: account@domain.com (Full Name) =GOOD. This will send both name and address when using the Send via E-mail Client option, and won’t trigger an error when using Send via SMTP.

     

     


    FileMaker Inc. provides this content on an “As Is” basis, without any warranty, and subject to the terms of the FileMaker Technical Network Agreement. FileMaker makes no representations and is not liable for any content or related information. You may use the content as part of your own solutions and for your customers, but you may not otherwise publicly distribute any content that you did not submit. ©2009-2011 FileMaker, Inc. All Rights Reserved. FileMaker is a trademark of FileMaker, Inc. registered in the U.S. and other countries.