Getting particular message from Mailbox

Hi!

I have the mail ID but couldn’t find a way to retrieve a message with this id directly
Currently I’m comparing this mail ID i have with all the mail IDs of the messages in the mailbox.

Is there a more direct way to retrieve a particular message from a mailbox?
(e.g. message with id 9870 from mailbox “Reports” of account “IMAP”)

any help is much appreciated!

I’m using Applescript to handle Mail.app in this case. :slight_smile:

Hi,

something like this


tell application "Mail"
	set theMessage to 1st message of inbox whose id is 5328
end tell

Thanx a lot!!! That worked perfectly! :slight_smile:

just to add on… if you want to pull out a particular mail with the id stored in a variable say matchingID

you could use


tell application "Mail"
	set theMessage to 1st message of inbox whose id is matchingID as number
end tell

works great for me!