Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用这个库IMAPX来获取电子邮件。
我还需要发送电子邮件,但不知道如何发送。
我尝试使用示例代码:
client.Folders["INBOX"].AppendMessage(msg)
但收到 AppendMessage 需要两个参数的错误,我无法弄清楚第二个参数应该是什么。
是否可以使用此库发送电子邮件,如果可以,如何发送?
根据Reflector,看起来第二个参数应该是string为新消息提供标志;看起来ImapFlags该类提供了可用标志的列表。
string
ImapFlags
如果您想了解更多 IMAP 的背景知识,那么您应该阅读它的RFC。
但是,IMAP 协议不用于发送邮件,它用于读取或检索服务器邮箱中的邮件。您可以使用它将消息添加到您自己的邮箱(正如您在此处尝试所做的那样),但这并不是大多数人在谈论发送电子邮件时的意思...... SMTP 是发送电子邮件的标准方式。