• 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 Script not recognizing Account?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mail Script not recognizing Account?


  • Subject: Re: Mail Script not recognizing Account?
  • From: Ed Stockly <email@hidden>
  • Date: Sat, 15 Sep 2007 09:31:51 -0700

set theMessage to make new outgoing message with properties  {account:"home", visible:true, subject:"Sample Subject", content:"hello" & return & return}

Why doesn't the message have the correct account assigned?

In Mail, I don't think the account is a property of a message, I think you want to set the sender.

Try this:

tell application "Mail"
tell (account 1 whose full name is "Hello")
set senderName to full name
set senderEmail to email addresses
set senderEmail to item 1 of senderEmail
set mySender to senderName & " <" & senderEmail & ">"
end tell
set theMessage to make new outgoing message with properties {sender:mySender, visible:true, subject:"Sample Subject", content:"hello" & return & return}
end tell
 

HTH,

ES
  
=
 _______________________________________________
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

  • Prev by Date: Re: Mail Script not recognizing Account?
  • Next by Date: Re: Paths that work fine from AS don't work when launched from the command line
  • Previous by thread: Re: Mail Script not recognizing Account?
  • Next by thread: Scripting Excel: How to find values in cells of kind date
  • Index(es):
    • Date
    • Thread