dm_mail_send Function

public function dm_mail_send(mail, server, error_message, error_curl, debug) result(rc)

Sends SMTP request by calling libcurl.

The function returns the following error codes:

  • E_CORRUPT if mail or server type is not initialised properly.
  • E_INVALID if mail or server data is invalid.
  • E_MAIL if libcurl initialisation failed.
  • E_MAIL_AUTH if SMTP authentication failed.
  • E_MAIL_CONNECT if connection to server could not be established.
  • E_MAIL_SSL if SSL/TLS error occured.

Arguments

Type IntentOptional Attributes Name
type(mail_type), intent(inout) :: mail

Mail type.

type(mail_server_type), intent(inout) :: server

Mail server type.

character(len=:), intent(out), optional, allocatable :: error_message

Error message.

integer, intent(out), optional :: error_curl

cURL error code.

logical, intent(in), optional :: debug

Output debug messages.

Return Value integer


Calls

proc~~dm_mail_send~~CallsGraph proc~dm_mail_send dm_mail_send curl_easy_cleanup curl_easy_cleanup proc~dm_mail_send->curl_easy_cleanup curl_easy_init curl_easy_init proc~dm_mail_send->curl_easy_init curl_easy_perform curl_easy_perform proc~dm_mail_send->curl_easy_perform curl_easy_setopt curl_easy_setopt proc~dm_mail_send->curl_easy_setopt curl_slist_append curl_slist_append proc~dm_mail_send->curl_slist_append curl_slist_free_all curl_slist_free_all proc~dm_mail_send->curl_slist_free_all interface~dm_mail_address dm_mail_address proc~dm_mail_send->interface~dm_mail_address proc~dm_is_error dm_is_error proc~dm_mail_send->proc~dm_is_error proc~dm_mail_error dm_mail_error proc~dm_mail_send->proc~dm_mail_error proc~dm_mail_error_message dm_mail_error_message proc~dm_mail_send->proc~dm_mail_error_message proc~dm_mail_write dm_mail_write proc~dm_mail_send->proc~dm_mail_write curl_easy_strerror curl_easy_strerror proc~dm_mail_error_message->curl_easy_strerror proc~dm_mail_write->interface~dm_mail_address proc~dm_time_rfc2822 dm_time_rfc2822 proc~dm_mail_write->proc~dm_time_rfc2822