Share this page

# smtp_logon

Simple Mail Transfer Vuser Functions (SMTP)

Logs on to an SMTP server.

    int smtp_logon( char *transaction, char *url, [ char *CommonName, char *LogonUser, char *LogonPass, char* LocalAddr, char* STARTTLS ,] LAST );

transaction | A transaction name for this step in quotes. To instruct VuGen not to create a transaction for this step, use an empty string, "".
url | The URL of the SMTP server, in the SMTP format style: "URL=smtp://user0001t@techno.merc–int.com" "URL=smtps://user0001t@techno.merc–int.com" "URL=smtp://user0001t@techno.merc–int.com:8181"
CommonName | Optional: A name for the login session in the following format: `"CommonName=Smtp Test User 0001"`
LogonUser | Optional: the user name for SMTP authentication. Use the following format: `"LogonUser=XXXX"`
LogonPass | Optional: the user password for SMTP authentication. Use the following format: `"LogonPass=XXXX"`
LocalAddr | Optional: Sets the preferred IP address of the client <ip_addr>[:<port>]. This option is useful for IP spoofing. Use the following format: "LocalAddr=199.123.123.123"
STARTTLS | Optional: Indicates that SMTP's StartTLS (Start Transport Layer Security) extension must be activated on the session. If the parameter is set, then the SMTP protocol's 'STARTTLS' command will be issued on the session during logon and connection will be switched to TLS mode. Use the following format : "STARTTLS"
LAST | A marker indicating the end of the argument list.

The smtp_logon function logs on to an SMTP server. It uses the format used by the FTP protocol.

This function is for use with global sessions. For multiple sessions, use the smtp_logon_ex function, which allows you to specify a session identifier.

## Return Values

If this function succeeds, it returns LR_PASS. Otherwise, it returns LR_FAIL.

## Parameterization

All arguments of this function of the type char, can be parameterized with standard parameterization.

## Example

In the following example, the smtp_logon function logs onto the techno server.

Copy code

    Action()
    {
        smtp_logon("Logon",
            "URL=smtp://user0001t@techno.merc–int.com",
             "CommonName=Smtp Test User 0001",
            LAST );
        smtp_send_mail(    "SendMail",
            "To=user0002t@merc–int.com",
            "Cc=user0003t@merc–int.com",
            "Subject=MIC Smtp: Sample Test",
            "MAILOPTIONS",
            "X–Priority: 3",
            "X–MSMail–Priority: Medium",
            "X–Mailer: Microsoft Outlook Express 5.50.4133.2400\r\n",
            "X–MimeOLE: By Microsoft MimeOLE V5.50.4133.2400\r\n",
            "MAILDATA",
            "MessageText="
                "Content–Type: text/plain;\r\n"
                "\tcharset=\"iso–8859–1\"\r\n"
                "Content–Transfer–Encoding: quoted–printable\r\n"
                "\r\n"
                "Test,\r\n"
                "<HTML><BODY>"
                "<H1><CENTER>PROGRESS UPDATE </CENTER></H1>"
                    "</BODY></HTML>\r\n",
            "MessageBlob=16384",
                    LAST );
        smtp_logout();
        return 1;
    }

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: