メッセージと添付ファイルを含むすべての連絡先に電子メールを送信するbashスクリプトを作成しようとしています。これは悪意のある目的のためではありません。Mac端末が添付ファイル付きで電子メールを送信
どうすればいいですか?これは可能ですか?前もって感謝します。私は以前、これを達成するためにuuencodeを使用している
メッセージと添付ファイルを含むすべての連絡先に電子メールを送信するbashスクリプトを作成しようとしています。これは悪意のある目的のためではありません。Mac端末が添付ファイル付きで電子メールを送信
どうすればいいですか?これは可能ですか?前もって感謝します。私は以前、これを達成するためにuuencodeを使用している
:
uuencode source.txt destination.txt | mail -s "subject of mail" [email protected]
あなたはbashスクリプトでこれを使用することができます。サンプル:
tell application "Mail"
tell (make new outgoing message)
set subject to "subject"
set content to "content"
-- set visible to true
make new to recipient at end of to recipients with properties {address:"[email protected]", name:"Name"}
make new attachment with properties {file name:(POSIX file "/tmp/test.txt")} at after the last paragraph
send
end tell
end tell
あなたはシェルから引数を渡すために、明示的な実行ハンドラを使用することができます:あなたはまた、AppleScriptを使用する場合があります
uuencode /usr/bin/xxx.c MyFile.c | mail -s "mailing my c file" [email protected]
私はfile.txtをどのように置き換えるのですか? 〜/ Path/To/file.txt?なぜ2つあるのですか? –
短い返信をおかけして申し訳ありません... uuencodeへの最初の引数はsourceで、2番目の引数は宛先ファイル名....ですので、好きな場合は:uuencode source.txt destination.txt | mail -s "subject" [email protected]これはローカルシステムからあなたのsource.txtをあなたの電子メールIDにfile.txtという名前で送るでしょう – Kush
ありがとう。 また、連絡先リストの全員に電子メールを送信するように、どうすればいいですか? –
osascript -e 'on run {a}
set text item delimiters to ";"
repeat with l in paragraphs of a
set {contact, address} to text items of l
end repeat
end run' "Name1;[email protected]
Name2;[email protected]"
」ですあなたのために保存されたすべての連絡先 "?これはアドレス帳アプリケーションの連絡先ですか?これにリンゴスクリプトを使用することを検討しましたか? – Floris