通过AppleScript的发送电子邮件时,发件人不正确 [英] Incorrect sender when sending Email via Applescript

查看:157
本文介绍了通过AppleScript的发送电子邮件时,发件人不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面的AppleScript的是,我已经使用了数年的形式。而且基本上是使用AppleScript发送电子邮件的一个众所周知的方法。

The Applescript below is in the form that I have used for a number of years. And is basically a well known method of sending emails using Applescript.

 tell application "Mail"
    set newMessage to make new outgoing message with properties {subject:"IP Address", content:"Your IP Address Is: 86.195.132.134"}
    tell newMessage
        set visible to false
        set sender to "mark@sender.com"
        make new to recipient at end of to recipients with properties {address:"recipient@mac.com"}
        send
    end tell
end tell

我今天刚注意到的是在脚本中的发件人电子邮件设置,可能不是一个Mail.app
如果没有选择其帐户邮箱使用。将如果选择了主收件箱或使用一个随机如果选择了单个邮箱,然后将用于从该帐户中的地址。

What I just noticed today is the 'sender' email set in the script, may not be the one Mail.app uses if its account mail box is not selected. A random one will be used if the main inbox is selected or if an individual mailbox is selected then an address from it's account will be used.

我想这是因为在邮件preferences,作曲之下。有一个设置为从发送新邮件:

I think this is because in the Mail preferences, under Composing. There is a setting to 'Send new messages from:'

您不能选择NO。唯一的选择是,或者是在组合框中的电子邮件地址中的一个选择邮箱的帐户下拉菜单。

You cannot select 'NO'. The only options are 'Account of selected mailbox' or one of the email addresses that are in the combo box drop down.

我必须承认,我不知道这是发生的事情之前,我去了狮子。

I must admit I do not know if this was been happening before I went to Lion.

有谁知道这个修复的,如果这是一个已知的bug ??。

Does anyone know of a fix for this, or if this is a known bug??.

感谢。

推荐答案

这为我工作就在刚才,希望它可以帮助:

this worked for me just now, hope it helps:

tell application "Mail"
  set theOutMessage to make new outgoing message with properties {visible:true}
  tell theOutMessage
    make new to recipient at end of to recipients with properties {address:"first@mail.com"}
    set sender to "Name Surname <name.surname@mail.com>"
    set subject to "Message Subject"
    set content to "Message Text"
  end tell
end tell

这篇关于通过AppleScript的发送电子邮件时,发件人不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆