Mail failing to send sound sought

Minor nagging topic as a weekend puzzler for those who like such things ;-)

Situation only affects those of us who frequently turn internet faucet on/off or live where there are interruptions etc.

It seems odd that… how many decades do we have the Mail App now… there is one sound for attempting to send an email and it, ah, sounds like success! But… if the email cannot go out for lack of internet connection, it hops over to the Outbox after making the sound without much further ado other than showing an Outbox in the sidebar, which, um, might occasionally be overlooked.

There are a couple of sound related settings in Mail, including:

which doesn’t actually play any sound when ‘no new messages are received’ (tested twice) but nothing for failing to send. No option in Rules for ‘if message enters Outbox’.

So I thought myself clever and sought an Automator or Shortcuts solution (when email lands in Mail Outbox > Play Sound xyz) but so far haven’t found one.

MacOS has such a nice collection of neglected sounds but here is a glaring situation where a ‘mail failed to send’ sound would be helpful, quite possibly ez to implement, and make the sound files happy. :thinking:

Maybe you can build on this Applescript to, say, check the Outbox after several minutes and notify you if there are still unsent emails:

tell application “Mail”
set theMailbox to mailbox “Outbox” of account “iCloud”
set messageCount to count of messages of theMailbox
end tell

[ test if messageCount > 0 and play sound if true]

(from a DuckDuckGo search - applescript mail “count of message” )

There should be a way to trigger this script in Shortcuts.

Thanks @mpainesyd I’ve never written any AppleScripts (unless Automator Applications count), am only vaguely familiar with it but your message contains enough keywords and ideas that I’ve found some interesting things in searching the Internet. Doubtful I’ll master it today but am on the right track.

Already opened ScriptEditor App, and in the Mail App Dictionary there are references to outbox and playing a sound so the pieces I’m seeking might be there, just need to figure out how to put them together!