4D Internet Commands v16SMTP_Auth |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D Internet Commands v16
SMTP_Auth
|
SMTP_Auth ( smtp_ID ; Benutzername ; Kennwort {; authMode} ) -> Funktionsergebnis | ||||||||
Parameter | Typ | Beschreibung | ||||||
smtp_ID | Lange Ganzzahl |
![]() |
Message reference | |||||
Benutzername | String |
![]() |
User name to be used for SMTP authentication | |||||
Kennwort | String |
![]() |
Password to be used for SMTP authentication | |||||
authMode | Ganzzahl |
![]() |
Authentication mode to be used: 0 or omitted = Mode defined by server 1= PLAIN, 2 = LOGIN, 3 = CRAM-MD5 | |||||
Funktionsergebnis | Ganzzahl |
![]() |
Error code | |||||
The SMTP_Auth command allows sending a message referenced by smtp_ID when an authentication mechanism is required by the SMTP server. This type of authentication is required by some SMTP servers in order to reduce the risk that messages have been falsified or that the sender's identity has been usurped, in particular for the purpose of spamming.
This command can be used whether authentication is needed or not since it is only executed if userName and password are not null strings.
smtp_ID is the long integer reference to the mail message created with the SMTP_New command.
userName is the authentication user name on the SMTP server. userName should not contain the domain. For example, for the address “jack@4d.com,” userName would just be “jack.”
password is the authentication password for userName on the SMTP server.
Note: If userName and/or password are null strings, the SMTP_Auth command is not executed.
The optional authMode parameter allows the “forcing” of the authentication mode used. You can pass 0, 1, 2 or 3 in this parameter:
This example enables sending a message with or without authentication depending on the content of specific fields stored in the 4D database:
C_LONGINT($vError)
C_LONGINT($vSmtp_id)
C_TEXT($vAuthUserName;$vAuthPassword)
$vError:=SMTP_New($vSmtp_id)
$vError:=SMTP_Host($vSmtp_id;"wkrp.com")
$vError:=SMTP_From($vSmtp_id;"herb_tarlick@wkrp.com")
$vError:=SMTP_Subject($vSmtp_id;"Are you there?")
$vError:=SMTP_To($vSmtp_id;"Dupont@wkrp.com")
$vError:=SMTP_Body($vSmtp_id;"Can we have a meeting?")
//The fields are entered if the server uses an authentication mechanism.
//Otherwise, null strings are returned.
$vAuthUserName:=[Account]AuthUser
$vAuthPassword:=[Account]AuthPass
$vError:=SMTP_Auth($vSmtp_id;$vAuthUserName;$vAuthPassword)
$vError:=SMTP_Send($vSmtp_id)
$vError:=SMTP_Clear($vSmtp_id)
Produkt: 4D Internet Commands
Thema: IC Send Mail
Nummer:
88851
Geändert: 4D Internet Commands 2003
4D Internet Commands ( 4D Internet Commands v16)