CURLOPT_MAIL_AUTH.3 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. .\" generated by cd2nroff 0.1 from CURLOPT_MAIL_AUTH.md
  2. .TH CURLOPT_MAIL_AUTH 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_MAIL_AUTH \- SMTP authentication address
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_MAIL_AUTH, char *auth);
  9. .fi
  10. .SH DESCRIPTION
  11. Pass a pointer to a null\-terminated string as parameter. This is used to
  12. specify the authentication address (identity) of a submitted message that is
  13. being relayed to another server.
  14. This optional parameter allows co\-operating agents in a trusted environment to
  15. communicate the authentication of individual messages and should only be used
  16. by the application program, using libcurl, if the application is itself a mail
  17. server acting in such an environment. If the application is operating as such
  18. and the AUTH address is not known or is invalid, then an empty string should
  19. be used for this parameter.
  20. Unlike \fICURLOPT_MAIL_FROM(3)\fP and \fICURLOPT_MAIL_RCPT(3)\fP, the address should not
  21. be specified within a pair of angled brackets (<>). However, if an empty
  22. string is used then a pair of brackets are sent by libcurl as required by RFC
  23. 2554.
  24. The application does not have to keep the string around after setting this
  25. option.
  26. .SH DEFAULT
  27. NULL
  28. .SH PROTOCOLS
  29. This functionality affects smtp only
  30. .SH EXAMPLE
  31. .nf
  32. int main(void)
  33. {
  34. CURL *curl = curl_easy_init();
  35. if(curl) {
  36. CURLcode res;
  37. curl_easy_setopt(curl, CURLOPT_URL, "smtp://example.com/");
  38. curl_easy_setopt(curl, CURLOPT_MAIL_AUTH, "<secret@cave>");
  39. res = curl_easy_perform(curl);
  40. curl_easy_cleanup(curl);
  41. }
  42. }
  43. .fi
  44. .SH AVAILABILITY
  45. Added in curl 7.25.0
  46. .SH RETURN VALUE
  47. Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
  48. CURLE_OUT_OF_MEMORY if there was insufficient heap space.
  49. .SH SEE ALSO
  50. .BR CURLOPT_MAIL_FROM (3),
  51. .BR CURLOPT_MAIL_RCPT (3)