Applescript发送带签名的电子邮件

Applescript to send an email with signature

我正在尝试使用 Apple 脚本发送电子邮件。一切正常,即使电子邮件已发送到脚本中使用的地址。我的问题是我无法在电子邮件内容中添加签名。这是代码

tell application "Mail"
    set theSubject to "Subject if the testing email" -- the subject
    set theContent to "Body of the email goes here" -- the content
    set theAddress to "test123@gmail.com" -- the receiver address
    set theSignatureName to "Charu" -- the signature name


    set msg to make new outgoing message with properties {subject:theSubject, content:theContent, visible:true}
    tell msg to make new to recipient at end of every to recipient with properties {address:theAddress}

    set message signature of msg to signature theSignatureName
    send msg
end tell

当我尝试 运行 时,我收到一条错误提示 Mail got an error: AppleEvent handler failed. 我不知道如何设置签名。

提前致谢

回顾以前的线程(如 this one),似乎对于 High Sierra 及更高版本,使用 message signature 添加签名不再有效。您最好的选择是将您的签名附加到 theContent.