Bug or not Sending Mail with Sierra not working

Since I upgraded to Sierra yesterday send mail is dumped into Draft folder and aren't sent??
**

This is driving me crazy!!!!!!!!!

**

Automator Works fine though??
Although "And leave open works fine.

Best Regards,
William Mabey 
Wednesday, September 21, 2016 6:20 PM

You think you’ve got problems. My iMac seems to be working OK but I can’t get onto the internet with wny of the Apple software on my Macbook Pro. That’s Safari, Mail, App Store, iTunes. Emails come in in Mail but there’s no content ot them. I can’t even read old mails. Fireworks and Thunderbird work fine and Network Diagnostics tell me that everything is fine.

Update on the above.
Safari and App Store have decide to start working for some reason, I can send emails with Mail but still can’t read my mails so hopefully things will improve.

Yes, looks to be the case. It could be either a change in the AppleScript support of Mail, or alternatively it could be just a plain bug in Mail.

@ccstone - do you have a Sierra Mac handy that you could check the AppleScript for sending a Mail message? You’re much better at AppleScript than I am.

Otherwise I’ll try to delve in to the AppleScript to determine if the issue is a change or a bug in Mail.

If Automator works, why not (at least as an interim solution) create an Automator workflow and run it from Keyboard Maestro with the Execute an Automator Workflow action?

1 Like

My Fix and works fine....Shenanigans... :confused:

Found script at AppleScript/Automate Mail Tasks

Cheers ヅ,
William Mabey 

1 Like

I’m facing exact same problem in mac os Sierra. All the emails from keyboard maestro gets saved in draft instead of sending.

Also, sometimes the email sent by keyboard maestro does nothing at all. Not even saves in draft.

Any solution?

1 Like

Same issue here. Since the AppleScript solution noted above works, it would seem that the solution lies in that arena.

1 Like

Keyboard Maestro uses essentially the same AppleScript, but configured with “visible:false” since you don’t want to see the message.

Unfortunately, this is broken in Mail in Sierra. Essentially this is a bug in Mail, and the only alternatives are:

  • Use AppleScript, and allow it to be visible.
  • Update Keyboard Maestro to make it visible.
  • Wait for Apple to fix Mail.

None of these are good options unfortunately.

2 Likes

I did a little bit of testing, and the visible flag for mail is decidedly different AppleScript for Sierra.

Visible:true sends the message when the send AppleScript command is used.

Visible:false places the message in the Drafts folder with the send AppleScript command is used. No message is sent.

The messages appear in the Sent or Drafts folder and are not opened in either case for the user (as they were in prior system versions, when the visible:true flag was used).

I think an AppleScript could be written which would imitate the opening of the email when dropped in the Drafts folder. This would simulate the “old” behavior of AppleScript for Mail.

Eric

Ok, here is code to get the most recent message in the Draft folder and open it:

`

tell application "Mail"
	set draftMessages to every message in drafts mailbox
	set draftMessagesID to {}

	# go through each draft message
	repeat with draftMessage in draftMessages
		set draftMessageID to id of draftMessage as string
		copy draftMessageID to the end of draftMessagesID
	end repeat

	# go through the list of draft message ids and process the most recent item
	if (count of the draftMessagesID) is greater than 0 then
		set sortedDraftMessagesID to the reverse of my sortAlphabetically(the draftMessagesID)
		# get only the first item, as this is the most recent
		set lastDraftMessageID to first item of sortedDraftMessagesID as integer
		# get the most recent draft message
		set theMessage to first message of drafts mailbox whose id is lastDraftMessageID
	
		tell theMessage
			open
		end tell
	
	end if

end tell

# handler to sort a list alphabetically
on sortAlphabetically(theList)
set the indexList to {}
set the sortedList to {}
repeat (the number of items in theList) times
	set the lowItem to ""
	repeat with i from 1 to (number of items in theList)
		if i is not in the indexList then
			set thisItem to item i of theList as string
			if the lowItem is "" then
				set the lowItem to thisItem
				set the lowItemIndex to i
			else if thisItem comes before the lowItem then
				set the lowItem to thisItem
				set the lowItemIndex to i
			end if
		end if
	end repeat
	set the end of sortedList to the lowItem
	set the end of the indexList to the lowItemIndex
end repeat
return the sortedList
end sortAlphabetically

`

Courtesy of flacle at StackOverflow.

Regards,

Eric

1 Like

Version 7.3.1 resolves this issue.

2 Likes

Thank you Peter :slight_smile:

1 Like