• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Mail Send Outgoing Message "success"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mail Send Outgoing Message "success"


  • Subject: Re: Mail Send Outgoing Message "success"
  • From: "S. J. Cunningham" <email@hidden>
  • Date: Mon, 11 Jan 2016 13:45:13 -0500


On Jan 11, 2016, at 8:20 AM, Christopher Stone wrote:

On Jan 10, 2016, at 15:55, S. J. Cunningham <email@hidden> wrote:
Apparently storing it in the outbox counts as success?!
______________________________________________________________________

Hey Steve,

Bleep!

Is there any way to tell if it was actually sent?  I guess I could check the outbox

I don't see any other obvious way.

tell application "Mail"
 if messages of outbox ≠ {}
   # Do something...
 end if
end tell

but that seems pretty lame.

Yes.

I modified your suggestion to allow for more than one message in the outbox and to allow time to send:

on reallySend(theMessage)
set aDecentAmountOfTime to 5 -- seconds
set tryTryAgain to 3
tell application "Mail"
set previousCount to count of messages of outbox
if not (send theMessage) then
error "Send Failed" number 101
end if
repeat with ifAtFirstYouDontSucceed from 1 to tryTryAgain
if (count of messages of outbox) > previousCount then
log "Waiting " & ifAtFirstYouDontSucceed
delay aDecentAmountOfTime
else
log "He's gone, Jim"
return
end if
end repeat
end tell
error "Message is stuck in the Outbox" number 102


end reallySend

I'd like to get the actual message ID but it is too ugly to even contemplate.

Steve
------------------
OS X 10.6.8, AppleScript 2.1.2

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Mail Send Outgoing Message "success" (From: "S. J. Cunningham" <email@hidden>)
 >Re: Mail Send Outgoing Message "success" (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: standard library
  • Next by Date: Re: AppleScript lists are O(1) vectors (was Re: AS Library Question)
  • Previous by thread: Re: Mail Send Outgoing Message "success"
  • Next by thread: UI Browser script library ?
  • Index(es):
    • Date
    • Thread