i'm using Mailkit library (Imap) for my project.
I can comfortably send a new message by SmtpClient.
currently I'm digging about how to reply to a particular mail. and is it possible to add more recipients to that reply mail ?
@jstedfast thanks for the wonderful one :)
Replying to a message is fairly simple. For the most part, you'd just create the reply message the same way you'd create any other message. There are only a few slight differences:
Subject
header with"Re: "
if the prefix doesn't already exist in the message you are replying to (in other words, if you are replying to a message with aSubject
of"Re: party tomorrow night!"
, you would not prefix it with another"Re: "
).In-Reply-To
header to the value of theMessage-Id
header in the original message.References
header into the reply message'sReferences
header and then append the original message'sMessage-Id
header.If this logic were to be expressed in code, it might look something like this:
Note: This code assumes that message.TextBody is not null. It's possible, although fairly unlikely, that this could happen (meaning that the message does not contain a
text/plain
body).