Simple Mail Transfer Vuser Functions (SMTP) > Alphabetical List of Functions > smtp_logon

smtp_logon

Example: 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.