How to mark Spam message in MailCore2 - email-spam

In INBOX folder, I can Archive message by setting MCOMessageFlagDeleted.
But I want to mark message as Spam, I don't know which way to do that?

Related

How to Detect Email that Lands in Inbox vs Spam of User with Amazon SES?

I would like to detect emails that arrive in the inbox (vs emails that land in the spam folder) sent using Amazon SES.
I know that I can set up notifications for delivered emails, bounced email, and emails with complaints.
When you get a delivery notification, does it mean that the email landed in the inbox and not in the spam folder, or does it only mean that the email didn't bounce and that the email provider didn't reject the email?
And if it only means that the email didn't bounce, is there a way to know what emails actually land in the inbox vs automatically landing in the spam folder of the user?
There is no way to know this information:
This is not specific to SES, but all email in general.
Each email reading application will handle SPAM in different way.
For example, in GMAIL, items in SPAM folder will not render or download external resources.
You will not be able to detect if a message has never been viewed and in an Inbox -vs- Spam folder.

How the mail notifications are working in Odoo14 for the Leave application, approval/rejection?

While applying, approving/rejecting the leave sometimes the emails are sent from the odoo14 system, but there is no mail template or mail sending functionality found in the leave module. Does anyone know how it's working? Images of the mail are below.
You can find the post message for leave acceptance here and for leave refusing here
The message_post method respect the user's preference. If the user changes the notification option from the user preferences in user form to Handle by Odoo rather than Handle by Emails,the user will not receive emails; instead, they will receive notifications in Odoo's UI.

Preventing an email from being sent to Outlook's Junk folder

I'm writing an application that creates a word document and emails it to a user from our shared mailbox. The code works fine, however the message is delivered to the Junk folder instead of the Inbox.
I believe this is because it's coming directly from the email address (mymailbox#company.com), instead of the mailbox name in our Global Address List (My Mailbox).
Is there a way to get VB.Net to recognize my Global Address List so I can send directly from the mailbox name; or is there another solution to this problem?
You can set the "from" address in mailmessage.from to the proper email address. However, the "from" address is usually not enough to get an email sent to the spam folder.
There are several steps you can take to make it more likely your email gets through. The links in the comment above Rachel Gallen cover these pretty well.
http://www.allspammedup.com/2009/09/7-ways-to-prevent-your-emails-being-blocked-as-spam/
http://www.interspire.com/content/2006/09/28/improve-your-email-delivery-rates/
Just why something ends up in the junk mail is something set by the recipient's email client and/or ISP and not something you have control over. You may be able to maximise your chances of appearing to be non-spam by making your email have fewer spammy characteristics - if you could re-cast your sending system to create the message as an email rather than an attachment this may help.

Read mail (IMAP) but only show messages from certain email address

Can I retrieve emails using IMAP server details from a UITextField and show them in a UITableView but only show emails which come from a certain email address (e.g. example#example.com)?
Thanks,
James
SMTP is for sending Mails, not receiving them. If you want to try IMAP for receiving check MailCore, it might help some hassle implementing IMAP.

Track bounced back newsletter emails

I've built a newsletter system which tracks:
Openings
Link clicks
Unsubscriptions
However, I need to find a way of tracking which newsletter emails 'bounced back'.
Has anyone done this before and whats the best way of doing it?
When sending the mail via SMTP you supply the FROM command which is sometimes referred to as the 'Sender' or 'Envelope Sender'. This is separate from the From: header in the email itself. What you want to do is to create a 'bounced' mailbox and set that as the 'Sender' for the email. If there is a bounce, then most mail servers will send a (NDR) notification back to this sender.
Then you need to periodically check this mailbox for NDR's and parse them for the original recipient and if it was a hard or soft bounce. There are various libraries that can do this for you such as ListNanny