Applescript to automatically reply to an email

Hi, I'm trying to create a script in Lion that will send an automatic reply to messages I receive with the subject line "Here's your offer". I am a BCC recipient of these messages, and I want to send the message to the actual recipient, not to the sender.
I created a rule to run an Applescript if the subject is "Here's your offer" but it's not doing anything. Even if it were working, I'm sure it's missing the code to send the message to the recipient in the To: field of the triggering message. I'd love some input on this script:
using terms from application "Mail"
          on perform mail action with messages theMessages for rule theRule
                    tell application "Mail"
                              repeat with thisMessage in theMessages
                                        set AppleScript's text item delimiters to {""}
                                        set thisSender to sender of theMessages
                                        set theNewMessage to reply thisMessage with opening window
                                        tell theNewMessage
                                                  set content to "Test message"
                                        end tell
  send theNewMessage
                              end repeat
                    end tell
          end perform mail action with messages
end using terms from

It is possible to create a new mail message using Applescript, and to send the message, or to bring up the new message window for further editing before sending. If, however, you start with the new message window (or a reply window, effectively the same thing) I don't think it is possible to have Applescript manipulate the new message, as there is no reference to it.
Unless your "boiler plate" text is very long, I would suggest looking at TextExpander. I strted using it back when it was freeware, but it has since gone commercial, for around $30, I think. It is a keystroke monitor, and when it sees keystroke sequences which you define it automatically replaces them with (or appends to them - your choice) predefined text. I don't know how long the replacement text can be - I only use short sequences - but you can have any number of sequences. So for example I type a.k.z (dots inserted to stop it working!) and it replaces it with my initials and the html link to my elephant icon. If you go for it I would recommend giving all your sequences the same pattern - mine are all two characters followed by z, so that ordinary words don't get accidentally substituted.
AK

Similar Messages

  • AppleScript for Auto Reply to an email with an Attachment????

    Forgive me. All this applescript stuff is fairly new to me. I've set up my Entourage email to automatically reply to certain rules that I have created. Well, I'm trying to have an attachment added to those auto replied emails. How can this be done? I'v researched for days and can only find stuff concerning Outlook Express which you are apparently given an option to add an attachment other than the mere text reply. Any info would be great!
    Thanks much,
    Robert

    try this Robert, works here for me using Entourage 11.3.3
    tell application "Microsoft Entourage"
    set theOrigionalMessage to the current messages
    end tell
    repeat with theMsg in theOrigionalMessage
    my ProcessMsg(theMsg)
    end repeat
    on ProcessMsg(theMsg)
    tell application "Microsoft Entourage"
    activate
    set theSender to sender's address of theMsg
    set theSubject to "Heres your attachment"
    set theBody to "test"
    set _Attachment to "Macintosh HD:Users:Budgie:Desktop:TEST.txt" as alias
    set MyReply to make new outgoing message with properties {recipient:theSender, subject:"Hello: " & theSubject, content:theBody}
    make new attachment at MyReply with properties {file:_Attachment}
    open MyReply --comment out if you dont need to view
    --send MyReply -- un comment to send without viewing
    end tell
    end ProcessMsg
    Budgie

  • Automatic Reply for all emails

    Dear All,
    We have this scenario in our company.
    We are  about to change our domain name in our emails.   i.e. [email protected]   to  [email protected]
    For a period of time we want to have a general automatic reply in our old emails (for every email we receive) which will mention the change and inform people to send their emails to the new address.
    Is there a way of creating a global automatic reply?   We use office 365.
    Thank you in advace,

    Hi,
    From the description, you want to deploy the automatic reply settings for all users in the environment, correct? Since the Automatic Reply settings are controlled by the server side, we may consider to change the settings from server side. See:
    http://blogs.technet.com/b/exchange/archive/2011/09/08/configure-automatic-replies-for-a-user-in-exchange-2010.aspx
    Since this forum is for general questions and feedback related to Office client side issue, I'd recommend you post a new question in the following forum to get further assistance:
    http://community.office365.com/en-us/f/158.aspx
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    Steve Fan
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Automatic "Reply to" address when sending emails?

    Is there a way to automatically include an address in the "Reply to" field in all my outgoing emails, similar to the way Mail can automatically put your own address in the CC or BCC field?

    Oh, I just found two possible ways in another thread but they have serious drawbacks:
    1. Change the "send new email from" address in the prefs. Unfortunately Mail won't let me create an account with my desired email address because the address I want to use has the same host and user name as my "From" address.
    2. Go into Terminal and make a permanent "Reply To" address. This method is so arcane and scary that I really don't like the idea, plus it's unchangeable.
    Apple should offer an option to include an automatic "reply to" feature. If they don't, they dropped the ball on that one.

  • HT1146 add an automatic reply onto email

    How do I add an automatic reply to Email?

    Hey The garden Doctor,
    Check out the following instructions, it'll go over how to have Mail automatically reply to messages:
    You can create a rule to have Mail automatically reply to incoming messages. For example, you can set up a rule that’s triggered by a specific subject so that Mail replies automatically to all messages with that subject.
    Choose Mail > Preferences, and then click Rules.
    Click Add Rule and type a descriptive name for the rule.
    Set the conditions necessary for the rule to apply to a message.
    From the “Perform the following actions” pop-up menu, choose “Reply to Message.”
    Click “Reply message text” and enter the text for your reply message.Mail will include the text you enter, along with the full text of the original message, in the reply that it sends.
    Mail must be running to automatically reply to messages, because rules aren’t processed when your Mac is shut down or you’re logged out. To set up automatic replies while you’re on vacation, ask your account provider how to set up an out-of-office reply.
    Carefully consider the rules you create for sending automated replies. If they’re too broad, you can send messages inadvertently or create message loops (replies to replies you sent). If possible, test the rules.
    After a rule has processed a message, the message’s status icon changes to a gray arrow to indicate that a reply was sent.
    via:
    Mail (Mountain Lion): Send automatic replies
    http://support.apple.com/kb/PH11760
    Cheers,
    David

  • When I send an email with a incorrect address I do not get a automatic reply.

    I used to get reply that the email did not go
    Grant

    This would be a function of the mail server that you are sending the mail to. Ask them why the error message has stopped. Thunderbird did its part and sent the email.

  • Reply ("From") email account automatically changes to 2nd email account

    I have 2 email accounts setup on my iPhone. Each has their own individual incoming and outgoing servers setup.
    If someone emails me on account "A" and I reply to them, my account "B" shows is the one they receive the email from.
    There is no way these accoutns are connected and I am sure that my "From" is setup to account "A".
    Why is this happening???
    p.s. On a side note...account "A" is my web hosting account. Account "B" is Gmail.
    Ever since I downloaded 4.2.1, I keep getting a popup message saying "Cannot verify server identity"
    p.p.s. When I open up account "A" and send a new mail, account "A" shows up as "from" to those people...it only happens when I reply to an email.

    bump

  • AppleScript Needed for reply-to heading replys

    I need help editing this script to reply to multiple emails I get from PayPal that will reply to the email's Reply-To Heading, not the From Heading, which of course is PayPal.
    This script works for everything but replying to the return path (Reply-To) address.
    Thank you in advance:
    set thesenders to {}
    set thesenderstext to ""
    tell application "Mail"
              set themessage to the selection
              repeat with i from 1 to the number of items in themessage
                        set thesender to (extract address from (the sender of (item i of themessage)))
                        if thesenders does not contain thesender then
                                  set thesenders to thesenders & {thesender}
                        end if
                        set the was replied to of (item i of the themessage) to true
              end repeat
              set AppleScript's text item delimiters to ", "
              set thesenderstext to thesenders as rich text
              set AppleScript's text item delimiters to ""
              set newMessage to make new outgoing message
              tell newMessage
                        set visible to true
      make new bcc recipient with properties {address:thesenderstext}
              end tell
              set toAddress to email addresses of item 1 of accounts as rich text
              tell newMessage
      make new to recipient with properties {address:toAddress}
              end tell
      activate
    end tell

    Try something like the following
                                            set theReplyTo to extract name from reply to of theMessage
                                            set theReplyToAddress to extract address from reply to of theMessage
    Note: It looks like it will automatically use the From address if there is no Reply-To header line. If the Reply-To line has now name to go with the address then the name seems to be filled in with the Reply-to address.

  • Exchange 2007 / Outlook 2013 "Your Automatic Reply Settings Cannot Be Displayed Because The Server Is Unavailable"

    One of our users is having problems setting replies from Outlook on his local PC.  This is an SBS 2008 Server with Exchange 2007.  The client PC is running Windows 8 with Outlook 2013.  This issue doesn't seem to affect other users but this
    is the only client with Outlook 2013.
    When trying to set an automatic reply from within Outlook 2013 we get the "Your automatic reply settings cannot be displayed because the server is unavailable".  Outlook seems to be connecting and working fine so connection to the server does
    exist.
    Trying this same operation from owa works without issue.  Please let me know what we need to do to find a solution.
    Thanks so much!

    Problem: 
    IMAP downloads inbox don't work after November patches.
    If you install a fresh OS and O2K13 unpatched ,the IMAP works fine.
    Fully patched O2K10 works fine too.
    It worked for my customer until November patch Tuesday broke the IMAP sync.
    Consultant opened case. 
    Response from Microsoft:
            This is with regards to the issue faced by you due to regression         caused by November security update. This is further to inform         you
    that fix is out and below is the download links for 32 bit         and 64 bit of the office suites. You need to apply all 3 hotfix.         The crash issue and IMAP issue would get resolved
    immediately         while the issue related to Free / Busy and OOF not getting set         would take 24-36 hours to start working once the patch is        
    applied.
    Below
            are the KB articles:
    Description
            of the Outlook 2013 hotfix package (Outlook-x-none.msp):         December 10, 2013:
    http://support.microsoft.com/kb/2825652        
    Description
            of the Word 2013 hotfix package (Word-x-none.msp): December 10,         2013:
    http://support.microsoft.com/kb/2837674        
    Description
            of the Office 2013 hotfix package (       2013:
    http://support.microsoft.com/kb/2849994        
        Description of the Office 2013 hotfix package (   December 10, 2013:
        http://support.microsoft.com/kb/2849994
    Issues that this hotfix package fixes
    Consider the following scenario:        
    You have a SharePoint Server environment that has complex             workflows.         
    You implement the ReceiveTimeOut registry entry to             increase the global timeout to 90 seconds.         
    You click Open this task             button to open a workflow task in Outlook 2013.       
            In this scenario, when you click any approval option from the         popup dialog box, you receive the following error message:        
    This task could not be updated at this               time.
    When you reply or forward an email message by using inline         replies, you cannot use the Close and Delete method of Outlook         Visual Basic for Application. Additionally, you
    receive the         following error message:        
    Run-time error '-2147467259               (80004005)': This method can't be used with an inline               response mail
    item.
    Consider the following scenario:        
    Assume that User A is located on an on-premises Exchange             Server, and User B is located on Cloud.         
    Both the on-premises Exchange Server and the Cloud enables             the Federation Trust.         
    User A share his own calendar to User B with Full Details             permission, and send the sharing invitation to User B.         
    User B opens the sharing invitation from User A, click             Open this Calendar, Outlook browses to the Calendar module             and opens
    the shared calendar.       
            In this scenario, the shared calendar does not show any content.     
    Consider the following scenario:        
    You install Outlook 2013 on Windows Server 2008 R2 or             Windows Server 2012 with Terminal Server Role installed.         
    You implement the Use Cached Exchange Mode for new and             Existing Outlook Profiles Group Policy settings and enable             it.       
            In this scenario, when you open the           Outlook Account Settings window, and double-click the         Exchange
    account, the Use Cached           Exchange Mode check box is not checked in the popup         dialog box.     
    Consider the following scenario:        
    You have an Exchange Server that has Public Folders.         
    You create the Outlook Security               Settings folder under
    All               Public Folders.         
    You publish the AdminSecurityMode registry entry and set             to a value of 1.          
    You configure Outlook 2013 to use cached mode.       
            In this scenario, when Outlook 2013 connects to Exchange Server,         Outlook crashes.   
        Description of the Word 2013 hotfix package (Word-x-none.msp):     December 10, 2013:
        http://support.microsoft.com/kb/2837674
        Assume that you open a meeting request in a separate window in     Outlook 2013. When you click
    Accept and     then click
    Send Reply Now,     Outlook crashes.
        Description of the Outlook 2013 hotfix package (Outlook-x-none.msp):     December 10, 2013:
        http://support.microsoft.com/kb/2825652
    Issues that this hotfix package fixes
    Assume that you have a recurring appointment that does not         have a subject. You make some changes to one instance of the         appointment and then save the instance. When you
    try to open or         delete the instance, Outlook may crash. Additionally, when you         drag-and-drop one instance of the appointment to a different        
    time in the calendar, Outlook may crash.     
    When you reply or forward an email message by using inline         replies, you cannot use the Close and Delete method of Outlook         Visual Basic for Application. Additionally, you
    receive the         following error message:        
    Run-time error '-2147467259               (80004005)': This method can't be used with an inline               response mail
    item.
    Consider the following scenario:        
    Assume that User A has a mailbox that is located on an             on-premises Exchange Server, and User B has a mailbox that             is located
    on Cloud.         
    Both the on-premises Exchange Server and the Cloud enable             the federation trust.         
    User A share his own calendar to User B with Full Details             permission, and send the sharing invitation to User B.         
    User B opens the sharing invitation from User A, click             Open this Calendar, Outlook browses to the Calendar module             and opens
    the shared calendar.       
            In this scenario, the shared calendar does not show any content.     
    Consider the following scenario:        
    You install Outlook 2013 on Windows Server 2008 R2 or             Windows Server 2012 with Terminal Server Role installed.         
    You implement the Use Cached               Exchange Mode for new and Existing Outlook Profiles             Group Policy
    settings and enable it.       
            In this scenario, when you open the           Outlook Account Settings window, and double-click the         Exchange
    account, the Use Cached           Exchange Mode check box is not checked in the popup         dialog box.     
    Consider the following scenario:        
    You have an Exchange Server that has Public Folders.         
    You create the Outlook Security               Settings folder under
    All               Public Folders.         
    You publish the AdminSecurityMode            
    registry entry and set to a value of 1.          
    You configure Outlook 2013 to use cached mode.       
            In this scenario, when Outlook 2013 connects to Exchange Server,         Outlook crashes.     
    Consider the following scenario:        
    You have two Active Directory forests (Forest A and Forest             B).         
    User A and User B have their mailboxes that are located on             Forest A.         
    User A share his own calendar with User B with Full             Details permission.         
    User B add the shared calendar and let it sync.         
    You move User B’s mailbox to Forest B.       
            In this scenario, the shared data in the shared calendar is         removed every second time that User A restarts Outlook. And it         is re-synced
    when User A browses to the Calendar module.
    Unfortunately TechNet isn't coming back, sorry folks :-(
    The 3 patches above immediately fixed the issue for me!
    Thanks so much!

  • How do I set up my mail to automatically reply that we are on holiday?

    How do I set up my mail to automatically reply that we are on holiday?

    From Mail Help:
    You can create a rule to have Mail automatically reply to incoming messages. For example, you can set up a rule that’s triggered by a specific subject so that Mail replies automatically to all messages with that subject.
    This feature is useful if you receive a lot of similar messages from an online form on a website, and you want to reply automatically.
    To automatically reply to messages:
    Choose Mail > Preferences and click Rules.
    Click Add Rule and type a descriptive name for the rule.
    Set the conditions necessary for the rule to apply to a message.
    From the “Perform the following actions” pop-up menu, choose “Reply to Message.”
    Click “Reply message text” and enter the text for your reply message.
    Mail will include the text you enter, along with the full text of the original message, in the message that it sends.
    Mail must be running to automatically reply to messages, because rules aren’t processed while your computer is shut down or you’re logged out. To set up automatic replies while you’re on vacation, ask your email service provider how to set up an out-of-office reply.
    Carefully consider the rules you create for sending automated replies. If they’re too broad, you can send messages inadvertently or create message loops (replies to replies you sent). If possible, test the rule.
    After a rule has processed a message, the message’s status icon changes to a gray arrow to indicate a reply was sent.

  • Automatic reply not working

    I am trying to get the automatic reply function to work under rules. However the reply just does not seem to work. No message is sent. I have been trying to get the rules to automatically reply if it see's an email to a particular email address but this just does not happen. I have tried deleting the message rules plist and that has not helped either.
    Any ideas ?

    Mail keeps information about outgoing servers in a separate list, independently of any specific mail account. The account settings just associate one of the available outgoing servers with each account. Orphaned or dangling outgoing server entries (i.e. not associated with any account) sometimes cause weird sending problems, so let's look at this possibility.
    Go to Preferences > Accounts > Account Information > Outgoing Mail Server (SMTP), choose Edit Server List from the popup menu, and delete any servers that shouldn't be there. The Edit Server List panel shows the account each outgoing server is associated with.
    BTW, have you tried manually replying to those messages? When you do that, do you observe anything that could be relevant here?

  • "Please don't reply to this email" Grr

    Is it just me, or does anyone else think it's really rude when people send emails with wording such as "Please don't reply to this email – it's been automatically generated by our computer. If you need to get in touch, please use the contact links below."?
    You can pretty much guarantee that none of the contact links will cover the subject of the original email. The impression it gives to me is one of a company that likes to tell me whatever they want, but isn't remotely interested in what I think as a customer.

    No, it's not just you
    But mine did have a link which (uniquely identified me) to a feedback survey
    And mine WAS because they were interested
    I received it on Saturday (21/08 at 21:05)
    It came from 'BT eContact Survey' (info@edigital********.***)
    Dear (my full name),
    You recently contacted BT and they'd like to hear what you thought about the way they fixed the problem, so much so they've asked us to ask you some questions. We really hope you can spare a few minutes as they're really keen to learn from your experience.
    Please click on the following link below to provide your feedback. The survey will only take 5-10 minutes to complete.
    (link removed)
    Many thanks,
    eDigital ******** - on behalf of BT eCustomer Service
    Note: this email was sent from a notification-only email address that cannot accept incoming email. Please do not reply to this message
    This is an independent market research study conducted by eDigital******** on behalf of BT. All information is stored on a secure server.
    Personal information collected will never be sold, shared, or rented without prior consent. Please direct any queries with this research to bt@edigital********.com
    I have made contact with the CEO, a rep from BT, the mods and via an online help link.
    My guess is it's from the help link.
    I'll never do that again!!
    and the problem wasn't fixed!!!
    -+-No longer a forum member-+-

  • Reply-all to email moves recipients to Cc

    When using the email client on my iPhone (iOS 8), whenever I reply to an email with 1 or more recipients on the To line, the email client automatically moves everyone but the last sender to the Cc folder.  This is undesirable behavior and I would like to know if there is a way to change this via settings.
    More details / steps to reproduce:
    I receive an email from PersonA, which was sent to PersonB, PersonC and myself (all on the To line of the mail)
    I use the Reply-All button to reply to all
    Expected behavior:  my email reply is sent to Persona, PersonB and PersonC (all of whom are on the To line).
    Actual Observed behavior:  my email reply is sent to Persona on the To line, but PersonB and PersonC are moved to the Cc line.
    Thank you.

    Hello pefrat,
    Welcome to the Apple Support Communities! I understand that when you “Reply All” to a message the additional recipients are moved to the "CC:" field. This is expected behavior in iOS as well as OS X Mail. Is there a reason you would rather have the recipients in the “To:” field as opposed to the “CC:” field?
    If you want to manually move the recipient address from the "CC:" field to the "To:" field, you can absolutely do so. Just keep in mind that the end result is the same:
    Write messages - iPhone
    http://help.apple.com/iphone/8/#/iph3caef30a
    Change a recipient from Cc to Bcc. After you enter recipients, you can drag them from one field to another or change their order.
    (This applies to the “To:” field as well)
    Cheers,
    Matt M.

  • Can AppleScript/Mail recover from non-existent email address?

    I have an AppleScript which automatically sends HTML emails after a delay of a few days from receipt of an incoming email produced by a web form. It works well except for one issue:
    The address it sends to are picked up from the web form so I have been testing failure modes for various badly formed email addresses. Most fail gracefully with NDNs except if the domain does not exist. In this case Mail opens a dialog window with "Cannot send message using server etc". This is not good for an unattended Mac automatically processing thousands of emails a day. Mail appears not to inform AppleScript of this glitch.
    Any thoughts about a solution would be appreciated.
    I only have Tiger and Leopard but this script will eventually run on a recent Mac.

    This is a style thing, but I try to write my code so it is easy to debug.
    if (do shell script "x='" & w & "';
    z=${x##*@};
    t=`dig +short ${z%>*} MX`;
    echo ${#t}") > 0 then display dialog "send"
    It is hard to debug what is being passed to Unix.
    I'd write this something like
    [[ I have not tested this ! ]]
    [ I have not taken in Hiroto's comments ]:
    -- I write the code so as to debug it.  I would not assume the statement above would work the first time.
    -- I let the log statements in the final code.  They do not do anything outside of the script editor.
    set toUnix to  "x='" & w & "';
    z=${x##*@};
    t=`dig +short ${z%>*} MX`;
    echo ${#t}"
    log "toUnix = " & toUnix
    set result to do shell toUnix
    log "result = " & result
    -- I do not understand this statement. Shoudn't we be testing for the length of result? Or not equal to null?
    if result > 0 then
      display dialog "send"

  • Automatic "Reply To:" field

    Can I set up Mail so that every message I send is automatically "Reply To:" a different email address?
    We have used yahoo mail for years and don't want to confuse people by changing our email address. However, I would love to use some of the outgoing features in mail. like notes, to-dos, and stationary. I know that I can compose a message and type in a different "Reply To:" email address, but can I set Mail up to do that automatically?
    Thanks
    Jnitram

    This might help:
    http://email.about.com/od/macosxmailtips/qt/etalwaysreplyto.htm
    I'm a bit confused why you don't just setup your Yahoo account in Mail and use it directly from there instead though.

Maybe you are looking for

  • WebCenter Collaboration 10.3 Performance

    I have deployed Oracle WebCenter 10.3 Interaction with Collaboration 10.3 on Windows 2003, deployed in .Net. The portal uses single sign-on and all communication is secure, using the ssl ports. When I launch project explorer from Collaboration within

  • Can't use Canon DR3060C

    Have a Canon DR3060C I can't use because I no longer have an IDE slot for SCSI 2. I can't find a non ide SCSI2 Card.  I can't find any kind of adapter (USB, Firewire) to scsi2.  Do I have a $4000 paper weight?

  • Can we delete members in dimension in Planning application using HAL

    <p>Hi</p><p>i added nearly 100 members in planning application usingHAL.</p><p>i wanted to delete those members. can i use HAL to deletemembers in dimension using HAL.</p><p>thanks,</p><p>Balu.</p>

  • M Lion upgrade, now iCal will only add events in one Calender (color).

      Before I could highlight a calender on the side bar & add a new event & it would appear in the highlighted calander's color.  Now, regardless of what calender is highlighted when I add a new event, iCal adds the event still as this one calendar & n

  • How to load inventory data

    hi till now i worked on sd ,pp now i got requirment to work on MM i know it is different from other modules . i need details abt mm how to load data into bw ,i know the functionality and data source .if u any one having screen shots how to load data