Mail (10.7 Lion) - Send Mail Bug?

tell application "Mail"
	set theNewMessage to make new outgoing message with properties {sender:"account2@a.com", visible:true}
	tell theNewMessage
		make new to recipient at end of to recipients with properties {address:"account1@a.com"}
	end tell
end tell

setup:

  1. create two accounts in mail account1 and account2
  2. setup bcc (apple > preferences > composing > automatically bcc)
  3. change account2… to account 2 of mail and account1 to account1 in mail
  4. set account1 as default
  5. run script.

issue:

  1. bcc remains the bcc for account1 instead of changing to account2 (this was not an issue in snow leopard)

question:

  1. the issue an actually issue or has something changed??

thanks

In Lion, I was able to duplicate this issue.

The trick that worked for me:

Do Steps 1-4.

Step 5. Set account2 as default
Step 6. Go back into setup bcc (apple > preferences > composing > automatically bcc) AGAIN.
Step 7. Change Account1 Back to the Default.
Step 8. run the script.

It seems that each account can store it’s own settings for that, though nothing in the prefs would lead you to believe it.

–OR –
Below the line


     make new to recipient at end of to recipients with properties {address:"account1@a.com"}

Add this and update the email addy:

make new bcc recipient at end of bcc recipients with properties {address:bccaddress@youremail.com}

Hope that helps!

Thanks, for the time and effort for replying.

I ended up just toggling the bcc off then on. Seems to work until the bug is fixed.


set always bcc myself to false
<script that changes the account>
set always bcc myself to true

thanks.