OS X Automator send mail

I would like to create an Automator application that reads the address book and sends an email from the default email account with the content of the addr. book search result.

Everything works except before sending the email the use is asked to press the send button. Is it possible to achieve this with no user interaction ?


Solution 1:

you can directly do an applescript to send an email and call it from automator:

   tell application "Mail"
      activate
      set newMessage to make new outgoing message with properties {account:"Account Detail", subject:"Mail Subject", content:"Content"}
      tell newMessage  
        make new to recipient at end of to recipients with properties {address:theRecipient}
        set visible to true
      end tell
      send newMessage
    end tell

You would just need to get theRecipient from the input passed to the AppleScript action. Also, you need to replace the properties on the third line with details of your Mail account.

set theRecipient to (item 1 of input)

should do it.