开发者

How to move a mail to SPAM ? Using Google Mail Migration API?

开发者 https://www.devze.com 2022-12-24 18:45 出处:网络
I am referring Link. To move migrated mails to Inbox we use: entries.MailItemProperties.Add(MailItemPropertyElement.INBOX);

I am referring Link. To move migrated mails to Inbox we use:

entries.MailItemProperties.Add(MailItemPropertyElement.INBOX);

Similarly for DRAFT,SENT e.t.c But there is no option开发者_开发问答 for spam mails.

How can i move mails to spam?


Add the label "Spam" to the message using the email migration API, and be sure to skip the inbox (don't set MailItemPropertyElement.INBOX.) There is no specific MailItemPropertyElement for it because the Spam label is reserved explicitly for spam messages.

MailItemEntry entry = new MailItemEntry();
entry.Rfc822Msg = new Rfc822MsgElement(rfcTextOfMessage);
entry.Labels.Add(new LabelElement("Spam"));

For more information please see the Email Migration .NET Developer's Guide. Good luck!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号