CURLOPT_MAIL_RCPT_ALLOWFAILS.3 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. .\" generated by cd2nroff 0.1 from CURLOPT_MAIL_RCPT_ALLOWFAILS.md
  2. .TH CURLOPT_MAIL_RCPT_ALLOWFAILS 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_MAIL_RCPT_ALLOWFAILS \- allow RCPT TO command to fail for some recipients
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_MAIL_RCPT_ALLOWFAILS,
  9. long allow);
  10. .fi
  11. .SH DESCRIPTION
  12. If \fIallow\fP is set to 1L, allow RCPT TO command to fail for some recipients.
  13. When sending data to multiple recipients, by default curl aborts the SMTP
  14. conversation if either one of the recipients causes the RCPT TO command to
  15. return an error.
  16. The default behavior can be changed by setting \fIallow\fP to 1L which makes
  17. libcurl ignore errors for individual recipients and proceed with the remaining
  18. accepted recipients.
  19. If all recipients trigger RCPT TO failures and this flag is specified, curl
  20. aborts the SMTP conversation and returns the error received from to the last
  21. RCPT TO command.
  22. .SH DEFAULT
  23. 0
  24. .SH PROTOCOLS
  25. This functionality affects smtp only
  26. .SH EXAMPLE
  27. .nf
  28. int main(void)
  29. {
  30. CURL *curl = curl_easy_init();
  31. if(curl) {
  32. struct curl_slist *list;
  33. CURLcode res;
  34. /* Adding one valid and one invalid email address */
  35. list = curl_slist_append(NULL, "person@example.com");
  36. list = curl_slist_append(list, "invalidemailaddress");
  37. curl_easy_setopt(curl, CURLOPT_URL, "smtp://example.com/");
  38. curl_easy_setopt(curl, CURLOPT_MAIL_RCPT_ALLOWFAILS, 1L);
  39. res = curl_easy_perform(curl);
  40. curl_slist_free_all(list);
  41. curl_easy_cleanup(curl);
  42. }
  43. }
  44. .fi
  45. .SH HISTORY
  46. This option was called CURLOPT_MAIL_RCPT_ALLLOWFAILS (with three instead of
  47. two letter L) before 8.2.0
  48. .SH AVAILABILITY
  49. Added in curl 8.2.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_FROM (3),
  54. .BR CURLOPT_MAIL_RCPT (3)