Jump to content
Sign in to follow this  

Email via sendmail

Recommended Posts

Hi all, this is just a volontary contribution to the community... :)


I was surprised to see that there is no Restrospect Event Handler which send the mail report by the unix sendmail. I am far from being anything like expert in unix so I decided to make one and learn some things about unix. Here is a the resut if anybody wants to use it:


1) first of all you need to enable sendmail. You can find eg on www.osxhints.com the recipies how to do it for different versions of OSX. I will not repeat it here.


2) You need to modify the event handler. Below is the modified sendMail function. Note one difference, if you want to send to more than one email adresses you need to have


property kMainGroup : "someone@here.there.com,otherone@elsewhere.com"


that is a string rather than a list


property kMainGroup : {"someone@here.there.com","otherone@elsewhere.com" }


( if you do not like this in one or two line you can probably modify my function to return to standard format)


here is the modified sendmail function




-- sendmail function for UNIX sendmail


to sendMail given Subject:subj, myMessage:bodyText, recipientsList:reciplist




if reciplist is {} or reciplist is "" or reciplist is {""} or bodyText is "" then return -- Nothing or no one to send to.


set mail_text to "echo Subject:" & subj & return & bodyText


set SendmailCommand to " |/usr/sbin/sendmail "


set longtext to mail_text & SendmailCommand & reciplist


set reciplist to reciplist as list


do shell script longtext




end sendMail






good day for all







Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this