我有一個註冊域,我使用hushmail作爲郵件提供者。我想從Mail.app發送電子郵件,就好像它們是從我的域發送的。出於安全原因(垃圾郵件),Hushmail SMTP服務器不允許使用與我的帳戶名稱不同的「發件人」地址。使用Applescript來設置「Reply-To」地址
我發現一種方法可以讓Apple郵件始終使用默認填充回覆郵件,這裏是:http://email.about.com/od/macosxmailtips/qt/etalwaysreplyto.htm但這對我來說過於激烈,因爲我的郵件客戶端中有多個郵件帳戶。
在Mail.app中,我可以手動設置「答覆到」字段,但Mail.app中沒有設置根據我選擇的郵箱自動填充。
到目前爲止,我有一個AppleScript,它能夠創建所選郵件的答覆:
tell application "Mail"
set theSelection to selection
if theSelection is {} then return
activate
repeat with thisMessage in theSelection
set theOutgoingMessage to reply thisMessage with opening window
# Wait for Mail.app to create the reply window
repeat until exists (window 1 whose name = "Re: " & subject of thisMessage)
end repeat
delay 0.1
#
# Here I want to set the reply-to address here based on the
# selected mailbox, or the "from" address of
# the current mail.
#
#
# The I need to restore the cursor to the body of the mail
# (if cursor was moved)
#
end repeat
end tell
我看了在AppleScript字典(文件 - >打開字典 - > Mail.app - >信息 - >信息 - >回覆),這似乎是我應該能夠設置一個屬性,但是當我做這樣的事情:
tell theOutgoingMessage
make new recipient at end of reply to with properties {address:"[email protected]"}
錯誤彈出說「郵件得到了一個錯誤:無法收到外發消息ID 65的回覆。「
我也試過
tell theOutgoingMessage
set reply to to "[email protected]"
但彈出一個錯誤說「郵件得到了一個錯誤:無法設置回覆傳出消息編號69的‘[email protected]’
我怎樣才能回覆到設定我剛剛創建的回覆郵件的財產
查看詞典顯示...回覆(text,r / o)。 r/o表示這是一個只讀屬性,因此您將無法以編程方式進行設置。您只能以編程方式閱讀它。因此,您必須使用ui元素腳本技術來完成。 – regulus6633