1CURLOPT_MAIL_FROM(3)       curl_easy_setopt options       CURLOPT_MAIL_FROM(3)
2
3
4

NAME

6       CURLOPT_MAIL_FROM - SMTP sender address
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_MAIL_FROM, char *from);
12

DESCRIPTION

14       Pass a pointer to a null-terminated string as parameter. This should be
15       used to specify the sender's email address when sending SMTP mail  with
16       libcurl.
17
18       An  originator  email  address should be specified with angled brackets
19       (<>) around it, which if not specified will be added automatically.
20
21       If this parameter is not specified then an empty address will  be  sent
22       to the mail server which may cause the email to be rejected.
23
24       The  application  does not have to keep the string around after setting
25       this option.
26

DEFAULT

28       blank
29

PROTOCOLS

31       SMTP
32

EXAMPLE

34       CURL *curl = curl_easy_init();
35       if(curl) {
36         curl_easy_setopt(curl, CURLOPT_URL, "smtp://example.com/");
37         curl_easy_setopt(curl, CURLOPT_MAIL_FROM, "president@example.com");
38         ret = curl_easy_perform(curl);
39         curl_easy_cleanup(curl);
40       }
41

AVAILABILITY

43       Added in 7.20.0
44

RETURN VALUE

46       Returns CURLE_OK if the option is  supported,  CURLE_UNKNOWN_OPTION  if
47       not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space.
48

SEE ALSO

50       CURLOPT_MAIL_RCPT(3), CURLOPT_MAIL_AUTH(3),
51
52
53
54libcurl 7.79.1                 November 04, 2020          CURLOPT_MAIL_FROM(3)
Impressum