通过 Applescript 发送电子邮件时发件人不正确

编程入门 行业动态 更新时间:2024-10-17 09:41:40
本文介绍了通过 Applescript 发送电子邮件时发件人不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

下面的 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"
        make new to recipient at end of to recipients with properties {address:"recipient@mac"}
        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.

我认为这是因为在邮件首选项中,在撰写下.有一个设置可以从以下位置发送新消息:"

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

您不能选择否".唯一的选项是所选邮箱的帐户"或组合框中下拉列表中的电子邮件地址之一.

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.

我必须承认,在我去 Lion 之前,我不知道是否发生了这种情况.

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

有没有人知道解决这个问题,或者这是一个已知的错误??.

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"}
    set sender to "Name Surname <name.surname@mail>"
    set subject to "Message Subject"
    set content to "Message Text"
  end tell
end tell

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

更多推荐

[db:关键词]

本文发布于:2023-04-17 14:51:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/915838.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:人不   发送电子邮件   正确   发件   Applescript

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!