Need AppleScript to Forward Email to Specific Person

I need an AppleScript to forward the selected message to a specific e-mail address. I want to be able to insert a comment in the message area at the top of the message thread—just as if I were doing it manually.
I have a script that creates a new message and copies the contents of the selected message to it. However, I lose all the formatting.
Can someone help me? Thanks.

I'm using this paste technique to do a mail forwarding like OP but I'm using the second last paragraph of the email set to a variable as the comment text.
Watching it loop thru the messages I can see the text gets pasted for a moment and then deleted. The script delays for 1 second then does the next email. I'm not sending them just composing them in Mail.
What could be cuasing the comment text to disappear. Sometimes it stays mostly it gets deleted.
tell application "Mail"
          try
                    set notes to {""}
                    set email_selection to (get selection)
                    repeat with a_msg in email_selection
                              set theText to content of a_msg
                              set their_name to words 2 thru -1 of paragraph 9 of theText
                              set comments to paragraph -5 of theText
                              set subscriber to paragraph 5 of theText
                              if comments ≠ "comments: " then
                                        set comments_LF to (comments as rich text) & return
  set the clipboard to comments as rich text
                                        copy {subscriber, comments as rich text} to the end of notes
                                        set the_forwarded_message to forward a_msg with opening window
                                        tell the_forwarded_message
                                                  make new to recipient at end of to recipients with properties {name:"Alastair Leith", address:"[email protected]"}
                                                  set subject to (their_name as rich text) & " has a comment on subscription form"
  activate
                                                  tell application "System Events" to keystroke "v" using {command down}
                                                  delay 0.1
                                        end tell
                              end if
                              tell application "AppleScript Editor"
  -- display dialog (notes as text)
                              end tell
                    end repeat
  -- display dialog (notes as rich text)
                    return notes
  -- display dialog notes
          on error the error_message number the error_number
                    tell application "AppleScript Editor"
                              display dialog "Error: " & the error_number & ". " & the error_message buttons {"OK"} default button 1
                    end tell
          end try
end tell

Similar Messages

  • Need to send notification to a specific person based on condition

    Please help.
    I need to send notification to a specific person based on condition. When a specific hold is placed on an invoice, send a notification to the Buyer who is referenced on the Purchase Order that is associated with that invoice. It will be an FYI notification.
    I'm looking at APINVHDN AP Hold Maiin Process. I thought possibly adding a notification into the "No" condition after the GET_APPROVER function since there would not be an approver on the invoice since it's on hold.
    Any ideas would be very much appreciated.

    Try the LiveCycle Designer forum.

  • Can I set an audible tone for when I receive an email from specific person?

    Can I set an audible tone for when I receive an email from specific person?

    http://manuals.info.apple.com/en_US/iphone_user_guide.pdf
    Look in the section on Mail beginning on page 51.

  • Exchange Server 2013 - Mailflow - Transport Rules - Forwarding Emails with Specific Text to Another Email Address

    Hi There,
    We are soon to implement Exchange 2013.
    Question: Is it possible to have emails with specific text such as "..SND.." to an other email address specified as well as the original recipient?
    Thanks very much.
    Lisa.

    Hi Amit,
    Thanks for answering my question. I have one more. To enable rules like this do you need to have an Exchange Edge Transport server installed or is this configured from an admin console within Exchange itself?
    Thank you,
    Lisa
    Lisa Stanley

  • Mail Rule Applescript to Forward Email Attachments Only

    Hi Everyone,
    I'm running 10.8.4 and Mail 6.5. Using Mail Rules, I'd like to forward emails containing attachments but not the message content (contained in the email to be forwarded). I am not an AppleScriptor but have tried to write code...with no luck. Does anyone know of such a script that can be activated using Mail Rules? Or propose a script I could use?

    Hi Everyone,
    I'm running 10.8.4 and Mail 6.5. Using Mail Rules, I'd like to forward emails containing attachments but not the message content (contained in the email to be forwarded). I am not an AppleScriptor but have tried to write code...with no luck. Does anyone know of such a script that can be activated using Mail Rules? Or propose a script I could use?

  • Can I forward emails from Mail to my work email when I'm there?

    Is is possible to have incoming Mail messages forwarded to another email address when I am at work? It takes too long to log into the web and check my home email at work when I'm there. I have outlook at work and it's way better than Mail (IMO). Can this be done?

    A rule is simply an automated action that occurs based on a set of conditions. The ability to make rules exists in just about all email applications including Outlook and Mail.
    One of the things I like about Mail is that making rules is a lot easier than in Outlook. But, there's no way to make an email client forward email to specific location by just checking a box because application doesn't know which messages you want forwarded and to where to send it until you tell it.
    Anyway, enough background....here's how to make a Rule in Mail:
    -Open Mail and select Mail->Preferences from the menu bar.
    -Click on the Rules tab and click the Add Rule button.
    -Type a name for your rule, e.g. "Forward to Work"
    -For conditions, select To and Contains from the drop-down menus, then type your home email address in the blank at the end.
    -For actions, select Forward Message from the drop-down menu and type your work email address in the blank.
    -Click the OK button.
    That's it. Now all messages to your home address will be forwarded to you work address.

  • IPhone won't receive emails from one specific person

    My iPhone 4S will not receive emails from one specific person.
    It sends and receives emails from anyone else ok, I can send emails to this person with out problem, but it will not receive them.
    If I check my webmail it is there, but it won't download to my phone? If I forward their email to myself from the web the forwarded one will be there, but not their original?
    I receive emails from others in the organisation ok. And it used to receive them all ok, on about December 27th it stopped?
    Anyone have any ideas on why this has happened and what I can do to fix it.
    Thanks
    Mike

    She did have a 1 in front of the number, however she deleted it and the texts still aren't going through. Any idea what else it could be?
    EDIT: Spoke too soon, just came through. It was just liek 20 minutes delayed.

  • Need to copy text messages from a specific person to PC

    I am need to make a copy of text messages from a specific person that I currently have on my phone.  I am wanting to transfer them to my PC and print out copies from there.  How do I do this?  I installed Handsent and tried to retrieve them that way but was unable to.  Also tried SMS backup and restore from the Market.  I am anticipating needing these messages in court. 

    Try an sms backup application that sends to an email address.
    Also the xml file created by sms backup & restore should be readable by excel or Internet Explorer.

  • HT5622 I have just received a new iphone 5s and need to set the Apple ID with my work email.  I used my work email on my personal iphone 4s to set up an icloud account and it will not let me use my work email as the Apple ID on my new iphone. What do I do

    I have just received a new iphone 5s and need to set the Apple ID with my work email.  I used my work email on my personal iphone 4s to set up an icloud account and it will not let me use this email as the Apple ID on my new iphone.  As it is a work phone I need to use this email address as my Apple ID.  How do I do this?

    when you open the app store scroll down to the bottom it will display the apple id currently in use, change it to your normal apple id email

  • HT1206 I need a work iTunes account for my work system, but used my work email address as an associated email to my personal iTunes account. Now I can't use the work email to create the new iTunes account.  how do I remove the email from my personal accou

    Since I upgraded to Mavericks from Snow Leopard I need a work iTunes account for my work system, but used my work email address as an associated email to my personal iTunes account.
    Now I can't use the work email to create the new iTunes account.  how do I remove the email from my personal account?

    You can long into an account via this page and update the email addresses that you have on it : http://appleid.apple.com

  • Forward email to a specific address to an Exchange mailbox

    I would like to know if it is possible to forward email to a specific address (for an Identity that doesn't exist) to a user's mailbox.
    Example: when our employees are terminated we delete their active directory accounts and email mailbox.  I'd like to be able to still forward any email to their old email address to their supervisor.
    Alternately I could set up the terminated employee as a mail contact: could I then set up the forwarding rule?

    Hi,
    Agree with the above suggestions, we can use transport rule:
    The recipient is 
    Redirect the message to
    For more information, you can refer to the followng articles:
    Transport Rule Predicates:
    http://technet.microsoft.com/en-us/library/dd638183(v=exchg.150).aspx
    Transport Rule Actions:
    http://technet.microsoft.com/en-us/library/aa998315(v=exchg.150).aspx
    Thanks,
    Angela Shi
    TechNet Community Support

  • How do you send an email to a specific person based on if a particular check box is checked?

    How do you send an email to a specific person based on if a particular check box is checked?

    Try the LiveCycle Designer forum.

  • I need to find a way to put emails on a personal folder that won't take up all my email space.

    I'm on a mac and I need to find a way to put emails on a personal folder that won't take up all my email space. I've tried 3 times to set them up, but I keep getting the "almost full" message every night.

    Can you tell us exactly what the "almost full" message says? Is it referring to your mailbox (ie, email server space), or your hard drive?
    If your email server is almost full, you can store folders and messages on your Mac. In Mail, go to the Mailbox menu, click New Mailbox, and choose the location "On My Mac". Then drag folders into that new mailbox to move them to your local computer, and off the email server.
    If your hard drive is full, this won't help, and you need a different approach.
    What version of OS X are you running? It helps us for you to put that information into your profile, since there are big differences between versions of OS X.
    Matt

  • Not too long ago I was able to delete personal info from forwarded emails in Hotmail, but not now. Works fine in IE. What's wrong and where? Txs

    Being paranoid, I like to delete personal info (email addresses, etc.) from emails I'm forwarding. Ican do this right now in IE, but not Firefox.
    I had been running FF4(?), but downgraded to FF3.5 because of some other issues, but I don't recall when the problem with email started (before or after downgrade).
    IE9 allows me to delete this personal info from forwarded emails.

    Try an SMC reset. The article covers when this is required, but doing this will not affect anything.
    Reset SMC

  • I want to change my iCloud account. Buying iPad we gave a virtual (forwarding) email addr. We need to change to a real address. But when we try to change the iCloud account, we can only change the password. Note: we don't have Mac, only iPad and Windows.

    I want to change my iCloud account. Buying iPad we gave a virtual (forwarding) email address.
    We need to change to a real address.
    But when we try to change the iCloud account, we can only change the password.
    Note: we don't have a Mac, only an iPad and Windows.

    Welcome to the Apple Community.
    Firstly, you need to change your details with Apple,  Start here, change your country if necessary and go to manage your account.
    In order to change your Apple ID or password for your iCloud account on your iOS device, you need to delete the account from your iOS device first, then add it back using your updated details. (Settings > iCloud, scroll down and hit "Delete Account")
    Providing you are simply updating your existing details and not changing to another account, when you delete your account, all the data that is synced with iCloud will also be deleted from the device (but not from iCloud), but will be synced back to your device when you login again.
    In order to change your Apple ID or password for your iCloud account on your computer, you need to sign out of the account from your computer first, then sign back in using your updated details. (System Preferences > iCloud, click the sign out button)
    In order to change your Apple ID or password for your iTunes account on your iOS device, you need to sign out from your iOS device first, then sign back in using your updated details. (Settings > iTunes & App store, scroll down and tap your ID)
    If you are using iMessages or FaceTime, you will also need to log out and into your ID there too.

Maybe you are looking for