Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old


Sets the user name string for the transfer.

Component Version macOS Windows Linux Server iOS SDK
CURL 2.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "CURL.SetOptionUserName"; curl; Value { ; Encoding } )   More


Parameter Description Example Flags
curl The CURL session handle. $curl
Value The user name "cs"
Encoding The text encoding for text parameter.
Default is UTF-8.
Possible encoding names: ANSI, ISO-8859-1, Latin1, Mac, Native, UTF-8, DOS, Hex, Base64 or Windows. More listed in the FAQ.
"UTF8" Optional


Returns "OK" on success.


Sets the user name string for the transfer.
In order to specify the password to be used in conjunction with the user name use the CURL.SetOptionPassword option.
Please check case as some services check names case sensitive.

See also USERNAME option in CURL manual.


Set login credentials:

Set Variable [ $result ; Wert: MBS("CURL.SetOptionUserName"; $curl; Logins::Username) ]
Set Variable [ $result ; Wert: MBS("CURL.SetOptionPassword"; $curl; Logins::Password) ]

Setup for IMAP with Google GMail:

Set Variable [ $curl ; Value: MBS("CURL.New") ]
Set Variable [ $r ; Value: MBS("CURL.SetOptionPort"; $curl; 993) // IMAP SSL port ]
Set Variable [ $r ; Value: MBS("CURL.SetOptionUseSSL"; $curl; 3) // require SSL ]
Set Variable [ $r ; Value: MBS("CURL.SetOptionSSLVersion"; $curl; 6) // TLSv1.2 ]
Set Variable [ $r ; Value: MBS("CURL.SetOptionURL"; $curl; "imaps://") ]
Set Variable [ $r ; Value: MBS("CURL.SetOptionUserName"; $curl; $user) ]
Set Variable [ $r ; Value: MBS("CURL.SetOptionPassword"; $curl; $pass) ]

Setup IMAP for Office 365:

Set Variable [ $r ; Value: MBS("CURL.SetOptionURL"; $curl; "imaps://") ]
Set Variable [ $r ; Value: MBS("CURL.SetOptionXOAuth2Bearer"; $curl; "eyJ0eXAiOi...") ] // your oAuth token
Set Variable [ $r ; Value: MBS("CURL.SetOptionUserName"; $curl; "") ] // no password needed!

See also

Example Databases

Blog Entries

Created 18th August 2014, last changed 2nd October 2023

CURL.SetOptionUserAgent - CURL.SetOptionVerbose