CURLOPT_MAIL_RCPT.3 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. .\" generated by cd2nroff 0.1 from CURLOPT_MAIL_RCPT.md
  2. .TH CURLOPT_MAIL_RCPT 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_MAIL_RCPT \- list of SMTP mail recipients
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_MAIL_RCPT,
  9. struct curl_slist *rcpts);
  10. .fi
  11. .SH DESCRIPTION
  12. Pass a pointer to a linked list of recipients to pass to the server in your
  13. SMTP mail request. The linked list should be a fully valid list of
  14. \fBstruct curl_slist\fP structs properly filled in. Use \fIcurl_slist_append(3)\fP to
  15. create the list and \fIcurl_slist_free_all(3)\fP to clean up an entire list.
  16. When performing a mail transfer, each recipient should be specified within a
  17. pair of angled brackets (<>), however, should you not use an angled bracket
  18. as the first character libcurl assumes you provided a single email address and
  19. encloses that address within brackets for you.
  20. When performing an address verification (\fBVRFY\fP command), each recipient
  21. should be specified as the username or username plus domain (as per Section
  22. 3.5 of RFC 5321).
  23. When performing a mailing list expand (\fBEXPN\fP command), each recipient
  24. should be specified using the mailing list name, such as \fIFriends\fP or
  25. \fILondon\-Office\fP.
  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. struct curl_slist *list;
  38. list = curl_slist_append(NULL, "root@localhost");
  39. list = curl_slist_append(list, "person@example.com");
  40. curl_easy_setopt(curl, CURLOPT_URL, "smtp://example.com/");
  41. curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, list);
  42. res = curl_easy_perform(curl);
  43. curl_slist_free_all(list);
  44. curl_easy_cleanup(curl);
  45. }
  46. }
  47. .fi
  48. .SH AVAILABILITY
  49. Added in curl 7.20.0
  50. .SH RETURN VALUE
  51. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  52. .SH SEE ALSO
  53. .BR CURLOPT_MAIL_AUTH (3),
  54. .BR CURLOPT_MAIL_FROM (3)