我正在使用 curl 库发送电子邮件。我能够成功发送电子邮件。我可以在接收端正确地看到 FROM、主题和正文。现在我需要在电子邮件中添加附件。我以这种方式遵循:http: //msdn.microsoft.com/en-us/library/ms526560 (v=exchg.10).aspx
static const char *text[]={
  "Date: Wed, 06 Feb 2013 12:30:30 +1100\n",
  "To: " RECIPIENT "\n",
  "From: " MAILFROM "\n",
  "MIME-Version: 1.0",
  "Content-Type: multipart/mixed",
  "boundary=""XXXXX""\n",
  "Subject: email example message\n",
  "--XXXXX",
  "\n", /* empty line to divide headers from body, see RFC5322 */
  "The body of the message starts here.\n",
  "Check RFC5322.\n",
  "--XXXXX",
  "Content-Type: text/plain" "\n",
  "Content-Disposition: attachment" "\n",
  "filename="FILE_PATH "\n",    
  "--XXXXX--",
  NULL
};
他们建议使用 RFC5322。但在那我找不到任何类似依恋的东西。这是对的吗?也欢迎使用 libcurl + C 语言的任何其他方式。
我认为名叫 Jorge 的人在 2012 年 10 月 13 日提出了同样的问题。但答案并不存在。