Sending email using apple script...

I have created a watch folder using apple script that when a file is dropped on it, it automatically opens, formats, and sends out a custom email.
What I don't understand is, how can I include multiple variables in the "content" section (also known as the body section of the email)? I want to put custom type in the content section that says "There is a file awaiting your review." I also would like to choose an email signature from my mail program to use. Third, I would like to include the name of the file that is being sent....
I found that by doing {content:iteminfo} I could get the file name...If I do {content:"There is a file awaiting your review."} I could get the custom type I wanted....
BUT, I can't figure out how to get BOTH of them together in ADDITION to adding a custom email signature...
I know there are some really smart people out there...Any tips?

I can't figure out how to get BOTH of them together
This is just standard AppleScript text concatenation with the &:
... {content: "There is a file awaiting your review: " & iteminfo}
Here you can see I'm concatenating a literal string (enclosed in quotes) and a variable. You can extend this ad infinitum.
As for the signature:
tell theMessage to set message signature to signature "My Sig"
(which assumes you have a signature named 'My Sig'. Adjust as necessary.

Similar Messages

  • Sending email using bash script

    Hello:
    I am working on writing a bash script to notify one or more users by email of certain events. Run from the Terminal command line, and having the script "echo" text of (what would be) a form letter with in-line variable expansion (i.e., ${VARIABLE}), all seems to work as anticipated. Eventually, I want cron to launch this shell script, and send an email to an "on-subnet" user (I have postfix enabled on my Mac, and there are multiple local user accounts).
    I found some stuff on the web about sending mail from bash scripts, and so I made a small little test script, that reads like this:
    #!/bin/bash
    VARIABLE[1]="The 12,345 quick brown foxes "
    VARIABLE[2]="jumped over the 67,890 lazy dogs."
    mail -s "a test email" jv << EOF
    This is a test:
    ${VARIABLE[1]}
    ${VARIABLE[2]}
    This is the last line of the test message.
    EOF
    echo "script completed"
    It worked... almost... It sent a local email to my postfix mail account that read like this:
    This is a test:
    The 12,345 quick brown foxes
    jumped over the 67,890 lazy dogs.
    This is the last line of the test message.
    EOF
    echo "script completed"
    So, I have two questions. First, the easy one (I hope):
    How do I delimit the end of the text, that I want to be the message body of the email, from portions of the script that follow said email text?
    Next question is a little more involved. You know how, in Mail.app, if you go to Mail Preferences>Accounts>Account Information, you can put multiple email addresses, comma-delimited, in the "Email Address" field? So, if a person entered "[email protected], [email protected], [email protected]" in this field, then, even though (s)he may be at home, and using their home ISP's mail server, (s)he could send an email apparently from either their home, work, or school email address. Of course, the mail headers clearly would show it came from and through their home machine and home ISP, but it would be displayed in the recipient's Mail client viewer as having come from one of [email protected], [email protected], or [email protected].
    I'd like to do something similar here, whereby the email (that is being sent to one or more local users' postfix account on my computer) would apparently be sent from "watchdog@localhost" rather than from "jv@localhost" like it seems to do by default. Whatever account the script is run from (or presumbably, whose cron tab is launching the script) is what the "From" address is set to.
    I'd rather not create an additional mail account, because I am using Mac OS X built-in accounts for the postfix mailboxes (I don't want to have to maintain a plaintext username:password file in postfix, and I don't want to create an additional user account on the computer).
    So, is there a way to specify an alternate "From" username when invoking the mail -s ${SUBJECT} ${RECIPIENT} command in a bash script? Or is there a different, alternate mail command that will let me do so? (please include a description of syntax and how I'd package the above message text for the alternate method).
    Thanks in advance, all!

    Hi j.v.,
    The > after EOF is just a typo (or may be added by the Discussion ?) and you must delete it; other > are prompts from the interactive shell. Andy's post shows an interactive use of shell, not a shell script (note the shell prompt % in front of the commands). A typical use of here document may look like
    command <<ENDOFDATA
    ENDOFDATA
    There must be no spaces before and after ENDOFDATA. The word ENDOFDATA can be EOF or any other string which is guaranteed not to appear in the text (the .... in the example above).
    You can modify the From: header by using sendmail command (postfix has it as a compatibility interface):
    /usr/sbin/sendmail -t <<EndOfMessage
    Subject: test mail
    To: jv
    From: watchdog
    This is a test:
    ${VARIABLE[1]}
    ${VARIABLE[2]}
    This is the last line of the test message.
    EndOfMessage
    There must be a blank line between the headers and the mail body.
    I assume that you send these mails only to users on your local Mac. Please do not send mails to remote users by using the sendmail command unless you know what you are doing completely.
    PowerMac G4   Mac OS X (10.4.5)  

  • Can't send email using Apple Mail with Verizon

    My Verizon settings in my Apple Mail program will not send mail. I am using my correct password and userid for authentication. I use outgoing.verizon.net server and port 587. Should I be using a different port setting?

    port 110 is the port number for the incoming (pop) mail server, port 25 is the port number for the outgoing (smtp) mail server. If they were insisting that you use port 110 for the outgoing (smtp) mail server, that is because the tech support rep with whom you spoke was not a very clueful person. These are established standard port numbers for those services.
    PS- should you have found anyone's post in this thread helpful to you, like Jim's, consider clicking the "helpful" or "solved" buttons in the header of said posts and if you don't click the "solved" button ("helpfuls" alone don't mark a thread as "answered"), then also consider marking this thread as "answered" for the benefit of others searching out a solution to a similar problem with their Verizon Mail configuration.

  • I am unable to send emails using apple mail, but can still receive

    A very odd situation this.  I have a couple of POP3 accounts and an Exchange server account.  All was going well until a few days ago when all my accounts stopped sending mail, but still continued to receive mail.  I have removed each account and restored it but this hasn't worked, the timer is constantly spinning against the 'Sent' header.  All these accounts work in their webmail version so I have to conclude the fault is with Apple Mail.  Can anyone help please?  Thanks.

    Troubleshooting Mail.
    http://support.apple.com/kb/ts3899

  • Can't send email using wifi. Spent 30 min troubleshooting with my email service provider who finally told me to contact Apple

    Can't send email using wifi. Spent 30 min troubleshooting with my email service provider who finally told me to contact Apple.
    It doesn't work when I can't get 3G, whether at home or overseas. Receives no problem, and 3G works fine when it's available.

    Maybe it is a 3GS. Anyway, I get the error that the network is not responding, and to check my settings. My ISP is Uniserve (Canada) but I am trying to use Telus (at home, where there is no 3G in my neighbourhood) or whatever is available as I travel eg. US or Europe for outgoing mail when 3G is not available. My husband has no problem with his iphone 4 when he sends email the same way usinf wifi.

  • Loss of sending email using WIFI

    As of this morning 8-20-08, after updating to 2.02, I no longer am able to send emails using my own wireless network. Previously this was no problem. Neither Fido or Apple have any idea of what I am talking about. Fido washed their hands as they do not support WIFI. How convenient, they sell the phone and charge for the service but do not support it. Videotron, my ISP, thinks the issue is my wireless router but I can send via gmail so that's out. I resovled the problem by configuring my accounts to use my gmail smtp server as a second option and now the spinning wheel is short lived and messages are sent.
    I'm sorry to say that I had fallen for all the hype about Apple but truth is they are but a Microsoft wannabe.
    Disinchanted

    So here's the wierd thing.
    I was having the same problems. Set up SMTP for Videotron when at home using relais.videotron.ca SMTP with no authenticationon port 25 & all was good in the world. However when I went out, bang. Nothing. Couldn't send a mail for love nor money.
    Thought aboutit & changed settings to use relais.videotron.ca SMTP, but this time using authentication of vltl** / password credentials with no SSL (Videotron doesn't use SSL) and again everything was fine. Of course, when I got home again, bang. Everything fell over & no more mail sending foe me!
    So I figure, when I'm at home I'm on my trusted network at port 25, I don't need authentication and all is good, but when I'm out i'm seen as potential SPAM by port 25 on videotron & get blocked.
    Tried using port 587 instead when for both home & mobile but had no luck either.
    Then a strange thing happened. I'd resolved to having to set up 2 SMTP servers on my iPhone & switching between the two based on where I was. Pain in the a**, but there's always a trade off for early adopter technology So I set up my primary SMTP to use port 25 with no authentication, and a secondary server to use the same relais.videotron.ca outgoing server, but this time WITH authentication using vltl** \ password credentials.
    After a walk to the shop when I'd been on my secondary SMTP server (successfully sending & recieving) I came home & inadvertantly forgot to swith back to my primary SMTP. Recieved a mail & then responded with no problem!
    Net result, I now have a permanently switced off primary server & a permanently switched on secondary server which uses relais.videotron.ca details with vltl** \ password authentication credentials active (like I did on my old silver iPhone) & all is good in the world, both at home & out mobile, both for sending & recieving!
    Will field test some more tomorrow but it may be a 2.0.2 bug where ther primary server details fcuk up whereas the secondary server details are stable.
    So long as it works, who cares!
    Jof

  • How can I send email using two different email address that both link back to my one exchange account on my Ipad mini

    How can I send email using two different email address that both link back to my one exchange account on my Ipad mini? 
    On my PC I simply have a master return email address and use a POP for the secondary address.  Both are through the one exchange account without a problem.  I need to be able to do the same on my Ipad.

    Ah, I should have made that clear.  My domain didn't come from google.  It was purchased at and is hosted at dreamhost, but I haven't used their email servers in years - I just route everything through gmail.  I actually have a bunch of domains (with websites).
    Gmail has an option that lets someone with custom domains send (and receive) email through gmail using the custom domain once Google confirms proper ownership of the domain (to prevent spammers and such).  Gmail has a setting for "send email as" which allows gmail to be sent using a custom domain as the sender.  I'm pretty sure Apple's old mobileme had this feature too, but I didn't use it.

  • IPhone cannot send email using Yahoo account. iPhone no envia correo Yahoo.

    Hi Everyone,
    I just got my iPhone from Movistar Venezuela and I've found I'm unable to send email using my Yahoo account. However, I can receive Yahoo email just fine (paid $20 for Mail Plus subscription), my GMail account can send and receive perfectly, and I can go surfin' Safari with no problems too.
    The error message I get is "Cannot send mail: an error occurred while delivering this message". I called Movistar Customer Support and they said everything was fine on their end...
    In typical Apple fashion, the error message is so simple I have no idea where the problem is. Does anyone know how can I get more information and how to solve this annoying problem? My Yahoo account is actually my primary account...
    Thanks in advance!
    Saludos a todos,
    Acabo de comprarme un iPhone de Movistar en Venezuela y me encuentro sin poder enviar emails con mi cuenta Yahoo. Sin embargo, si puedo recibir correo Yahoo bien (pague $20 por mi suscripcion a Mail Plus), mi cuenta de GMail si puede enviar y recibir email sin problema y puedo navergar con Safari sin ningun problema.
    El mensaje de error que recibo es el siguiente": "No se puede enviar correo: se ha producido un error al enviar el mensaje". Llame a Atencion al Cliente de Movistar y me dijeron que no habia ningun problema con mi linea o con su servicio de datos...
    Como tipica cosa Apple, el mensaje de error es tan simple que no tengo NI IDEA de cual es el problema. Alguien mas ha sufrido este problema? Sabe alguien como puedo obtener mas informacion de este error y como solucionarlo? Lamentablemente, mi cuenta Yahoo es mi correo principal...
    Gracias de antemano!

    Creo que resolvi el problema, temporalmente.
    1) Borra tu cuenta
    2) Vuelvela a crear
    3) Ve a Ajustes
    4) Ve a Mail Contactos Calendarios
    5) Ve a la cuenta problematica
    6) Ve a SMTP
    7) Anadir nuevo
    8)
    Nombre servidor: smtp.mail.yahoo.com
    Nombre de usuario: no dejar vacio
    Contrasena: no dejar vacio
    Usar SSL: si
    Autenticacion: Contrasena
    Puerto del Servidor: 25
    Lo consegui de aqui: http://www.emailaddressmanager.com/tips/mail-settings.html
    Dime que tal te funciona.
    I think I solved the issue, temporarily at least
    1) Delete account
    2) Create again
    3) Go to settings
    4) Go to Mail, Contacts, Calendars
    5) Open problematic account
    6) Go to SMTP
    7) Add a new server
    8)
    Name: smtp.mail.yahoo.com
    User name: do not leave blank
    Password: do not leave blank
    SSL: Yes
    Autentication: Password
    Port: 25
    I got this info from: http://www.emailaddressmanager.com/tips/mail-settings.html
    Let me know how this works

  • I am unable to send emails using iCloud, but am receiving.

    I am unable to send emails using iCloud from both my laptop and my ipad.  I am paying for 25Gb of storage and am only using 3Gb at the moment.  I get the following message " Your email has been placed in the Outbox as you have exceeded your limit for sending emails".  I have not sent any emails today at all!

    http://support.apple.com/kb/ht4863
    Or contact Apple:  https://getsupport.apple.com

  • Help with moving contact info using Apple Script in Address Book

    Hi folks,
    I wonder if someone can help? I imported a few hundred contacts via a Gmail created vCard into my Address Book. The problem is that instead of inserting the email addresses into one of the email fields for each record, it has inserted the email address into the Notes field as follows: "EmailAddress: [email protected]".
    I would like help to write an Apple Script that will search my contacts in Address Book, find those with "EmailAddress:" in the notes field, cut the email address that follows it, and pastes it into the Work Email field, carries out the operation for the whole address book and saves the changes.
    Can anyone help me write a script for this. I've not used Apple Script before so this will be my first attempt!
    Thanks in advance,
    ayworld

    This should work:
    tell application "Contacts"
      activate
              set thePeople to every person whose note contains "EmailAddress:"
              set {oldTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, ":"}
              repeat with thePerson in thePeople
                   set nn to thePerson's note
                    make new email at end of emails of thePerson with properties {label:"Notes", value:text item 2 of nn}
              end repeat
      save
    end tell
    It will leave the entry in notes and make the label of the new email 'Notes"
    Normally when I post an AppleScript like this I tell the user to test it out before using it on the actual data but in this case I don;t know how you'd do that given there is only one Contacts and only one Contacts database.
    Just make sure you have a backup just in case. I tried it here on some dummy entries in my Contacts and it worked OK.
    Again this totaly relies on the data you presented. The Notes field has to be in the format
    EmailAddress:[email protected]
    for this to work.
    regards
    Message was edited by: Frank Caggiano - If you select all the text in the box, then right click and select Make new AppleScript the script will open in the AppleScript editor. Just make sure you get all the text it is easy to drop the first or last char when selecting.

  • New to Flash, create a flash form which is emailed using CGI script when submit button is pressed

    I'm trying to build a form in flash that is emailed using CGI
    script. I'm just lost and confused and I just can't seem to figure
    this out.
    This is the CGI coding for HTML and I just need to convert it
    to use in CS3:
    <form action="
    http://www.hostmonster.com/monstermail"
    enctype="multipart/form-data" method="POST">
    Name: <input type="text" name="Name"><br>
    Email: <input type="text" name="mailfrom"><br>
    Phone: <input type="text" name="Phone"><br>
    Service: <input type="text" name="Service"><br>
    <input type="hidden" name="sendtoemail"
    value="[email protected]"><br>
    <input type="submit" value="Send Email">
    </form>
    This is a link to what I'm working on:
    http://www.alternativesolutionsforyou.com/contact.htm

    OK, sorry....no more errors when I test the movie but when I
    test it live....nothing happens???? Here's the link again:
    http://www.alternativesolutionsforyou.com/contact.htm
    Code as it is:
    lv=new LoadVars();
    lv.Name=name.text;
    lv.mailfrom=email.text;
    lv.Phone=phone.text;
    lv.Service=service.text;
    lv.sendtoemail="[email protected]"
    yourSubmitButton.onPress=function(){
    lv.sendAndLoad("
    http://www.hostmonster.com/monstermail",lv,"POST");
    lv.onData=function(){
    // data successfully sent
    // this will execute if your cgi script returns something
    after executing
    I haven't adjusted what happens after you his the submit
    button yet.....just trying to get the email working.

  • Since 2 days can't send emails via Apple Mail

    Hi,
    for 2 days now I'm unable to send emails from Apple Mail.
    I have an Hotmail account (using POP3) and a WEB.DE account (using IMAP) connected with Mail. Every time I try to send an email Mail tells me the SMTP server are offline. My mobile.me account though works properly.
    To exclude problems with certain ports on my WLAN router I tried to use Thunderbird on my Windows PC with these accounts. Sending emails this way wasn't a problem at all.
    Also deleting all accounts and setting them up again didn't make a change...
    Even changing the OS back from Lion to SL hasn't made an impact.
    Any suggestions what might cause this weird problem?

    Hello P:
    Since each one is different, I suspect the best answer to your question lies with your ISP.
    Barry

  • Hi all please i want reset security questions but not send email from apple to my email

    please help me hi all please i want reset security questions but not send email from apple to my email

    Alternatives for Help Resetting Security Questions and/or Rescue Mail
         1. If you have a valid rescue email address, then use this procedure:
             Rescue email address and how to reset Apple ID security questions.
         2. Fill out and submit this form. Select the topic, Account Security. You must
             have a Rescue Email to use this option.
         3. This is the only option if you do not already have a valid Rescue Email.
             These are telephone numbers for contacting Apple Support in your country.
             Apple ID- Contacting Apple for help with Apple ID account security. Select
             the appropriate country and call. Ask to speak to the Account Security Team.
    Note: If you have already forgotten your security questions, then you cannot
             set up a rescue email address in order to reset them. You must set up
             the rescue email address beforehand.
    Your Apple ID: Manage My Apple ID.
                             Apple ID- All about Apple ID security questions.

  • TS2621 Problem sending emails using iphone 4

    I cannot send emails using my iphone 4.  All the mails can be received without any problem.  I don't have data plan and use wi-fi to access the internet.  Any suggestion is much appreciated.  Thanks

    iOS: Unable to send or receive email
    http://support.apple.com/kb/TS3899
    Can’t Send Emails on iPad – Troubleshooting Steps
    http://ipadhelp.com/ipad-help/ipad-cant-send-emails-troubleshooting-steps/
    Setting up and troubleshooting Mail
    http://www.apple.com/support/ipad/assistant/mail/
    iPad Mail
    http://www.apple.com/support/ipad/mail/
    Try this first - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.)
    Or this - Delete the account in Mail and then set it up again. Settings->Mail, Contacts, Calendars -> Accounts   Tap on the Account, then on the red button that says Remove Account.
     Cheers, Tom

  • How to Email Concurrent Program Output to Email using Shell Script

    Hi All,
    Have a Nice Day,
    I have a tricky requirement and i was not able to achieve, let me explain my requirement
    I have created a PLSQL Concurrent Program named "Approval Update". This will do update and it display the number of rows updated.
    Now i need to take this concurrent program output and it needs to be send it to the person who submits this program as an email using shell scripts.
    I have referred meta link note as well as some OTN posts but I was not able to achieve this.
    Please help me to complete this As soon as possible, Thanks in advance for your help.
    Let me know if you need more clarifications.
    Regards,
    CSK

    I don't have much idea in shell scripts all i want is, in my shell script i need to get the parent concurrent program output and that needs to be emailed to the intended person.
    Please help to to get the shell script commands for this.I do not have any shell script to share, sorry! If you want the query to get the parent request_id so you can get the log/out file name/location from then please refer to:
    REQUESTS.sql Script for Parent/Child Request IDs and Trace File IDs [ID 280295.1]
    http://etrm.oracle.com/pls/et1211d9/etrm_pnav.show_object?c_name=FND_CONC_REQ_SUMMARY_V&c_owner=APPS&c_type=VIEW
    http://etrm.oracle.com/pls/et1211d9/etrm_pnav.show_object?c_name=FND_CONCURRENT_REQUESTS&c_owner=APPLSYS&c_type=TABLE -- LOGFILE_NAME & OUTFILE_NAME
    Thanks,
    Hussein

Maybe you are looking for

  • UCM VCR adapter for weblogic portal.

    Hi, Where can I find the UCM VCR adapter installable, tried searching the patch release as described in the oracle documentation but was not a success. we are using weblogic portal server version is 10.3.0.0 Thanks & Regards, Prashant.

  • 问两个特别初级的问题,也不知道去哪问.关于SAP Dashboard Design的.

    我在sap的官网上看到Crystal Dashboard Design个人完整版要四万多,Crystal Dashboard Design部门版只有8000多,是个人完整版的五分之一.但是在功能对比上,部门版却比个人版多了两项,包括:连接至 Adobe LiveCycle Data Services和IBM Websphere.Microsoft SharePoint 和 Microsoft SQL Server Reporting Services 集成. 我想问两个问题,一个是个人完整版与部

  • Solid State Hybrid Drive upgrade?

    I need more storage on my internal drive (original 500 GB, 5400 RPM, HDD) and I would like to speed up R/W performance as well. Based on what I have researched, I am considering the Seagate Momentus XT 750 GB (7500 RPM) SSHD to upgrade my MBP from OW

  • Pluggable Mapping: java.lang.ArrayIndexOutOfBoundsException: 5

    Hi, I'm using OWB10gR2. I got a "java.lang.ArrayIndexOutOfBoundsException: 5" when I try to insert a Pluggable Mapping (which is from a licensing point of view an expensive option). The only thing I can do in such a case is to exit witout being able

  • Package Quotation item category not populating

    Hi, I am trying to create a package quotation for a package product in CRM 2007. When I am adding the package product to the package quotation, the item category of the package items (components of product package) is not getting determined. I tried