• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Need help sending emails via AppleScript (without a mail client)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need help sending emails via AppleScript (without a mail client)


  • Subject: Re: Need help sending emails via AppleScript (without a mail client)
  • From: Axel Luttgens <email@hidden>
  • Date: Sun, 10 Nov 2013 10:55:52 +0100

Le 9 nov. 2013 à 20:30, Christian Boyce <email@hidden> a écrit :

> I used to use the 24U Email OSAX but it's not working for me in 10.8, and I'm not getting anywhere trying to contact the 24U people (no response to multiple emails). I wonder whether anyone has a suggestion that will help me to send emails via AppleScript without bringing up a mail client-- another OSAX, a shell script, something. Does not have to be very flexible as every email will have the same sending and receiving addresses.

Hello Christian,

Assuming you have to send emails through your ISP's server (e.g. "myisp.relay.com"), you could make use of the /usr/bin/nc command. This is not the most reliable way, since one has to simulate a SMTP conversation by sending all commands in a batch, instead of waiting for the server's reply after each command; but for simple mail transactions, this should work most of the time.

Here's an example:

--
set Replies to do shell script "/usr/bin/nc myisp.relay.com 25 <<END_OF_DATA
ehlo [127.0.0.1]
mail from:<email@hidden>
rcpt to:<email@hidden>
data
From: John Doe <email@hidden>
To: Mary Jane <anotherdomain.com>
Subject: Test message

Hello

This is a test message.

Greetings,
John
.
quit
END_OF_DATA"
--

In case of successful submission, variable Replies should contain a line beginning with "250".
More generally, the value of that variable may prove helpful for diagnosing what the server doesn't like (e.g. a bracketed ip address instead of a host name in the EHLO command).

HTH,
Axel
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden


References: 
 >Need help sending emails via AppleScript (without a mail client) (From: Christian Boyce <email@hidden>)

  • Prev by Date: Re: Mavericks AppleScript Editor formatting problems redux
  • Next by Date: Re: Mavericks AppleScript Editor formatting problems redux
  • Previous by thread: Need help sending emails via AppleScript (without a mail client)
  • Next by thread: Re: Need help sending emails via AppleScript (without a mail client)
  • Index(es):
    • Date
    • Thread