curl :: CurlMail :: set_outgoing_server
# Configure server host and user credentials if needed.
fun set_outgoing_server(host: String, user: nullable String, pwd: nullable String): nullable CurlResponseFailed
do
# Check Curl initialisation
if not self.curl.is_ok then return answer_failure(0, "Curl instance is not correctly initialized")
var err
# Host & Protocol
err = is_supported_outgoing_protocol(host)
if not err.is_ok then return answer_failure(err.to_i, err.to_s)
err = self.curl.native.easy_setopt(new CURLOption.url, host)
if not err.is_ok then return answer_failure(err.to_i, err.to_s)
# Credentials
if not user == null and not pwd == null then
err = self.curl.native.easy_setopt(new CURLOption.username, user)
if not err.is_ok then return answer_failure(err.to_i, err.to_s)
err = self.curl.native.easy_setopt(new CURLOption.password, pwd)
if not err.is_ok then return answer_failure(err.to_i, err.to_s)
end
return null
end
lib/curl/curl.nit:420,2--445,4