AppleScript to Send Again E-Mail Message in Sent Folder

For reasons more complicated than interesting, I want to use Send Again to reply to incoming e-mails that meet certain specific conditions. I've figured out how to extract the sender's e-mail address from the message, but I can't figure out how to select a previously sent message and resend it to the new recipient. I'd really appreciate any help. Thanks.

Here's what I've got so far:
tell application "Mail"
set theMessage to selection
set the thisMessage to item 1 of the theMessage
set theSender to sender of the thisMessage
set theAddress to extract address from theSender
set sendAgain to 1st message of sent mailbox whose id is 343445
-- Need to tell Mail to Send Again the message sendAgain
set sender of (message sendAgain) to theAddress
-- Need to send message
end tell
I get the error on the last line: "Mail got an error: Can’t set message (message id 343445 of mailbox "[Gmail]/Sent Mail" of account "User Name") to "[email protected]".

Similar Messages

  • The user or users have been added successfully, but there was an error in sending the e-mail message. The server may not be set up correctly to send e-mail. To verify that e-mail is configured correctly, contact your server administrator

    I got this problem when I tried to configure out-going email and add an account to farm administrator group.
    I configure out-going email according to this website http://technet.microsoft.com/en-us/library/cc288949.aspx
    Here are the screen shots.
    The SMTP server and email accounts work out OK when I use Outlook 2010 to test.
    Anyone can help me about it? Thanks.
    Here is the log.
    09/20/2012 09:21:00.36 w3wp.exe (0x1F7C)                      
    0x1138
    SharePoint Foundation         E-Mail                        
    8gsf
    High    
    #160008: The e-mail address 'admin3.sharepoint@domain' contains illegal
    characters. df98555c-612f-4a58-9443-ab6e9a4fcc53
    09/20/2012 09:21:00.36 w3wp.exe (0x1F7C)                      
    0x1138
    SharePoint Foundation         General                      
    8kh7 High    
    Cannot complete this action.  Please try again.
    df98555c-612f-4a58-9443-ab6e9a4fcc53
    09/20/2012 09:21:00.36 w3wp.exe (0x1F7C)                      
    0x1138
    SharePoint Foundation         E-Mail                        
    7946 Critical
    Cannot complete this action.  Please try again.
    df98555c-612f-4a58-9443-ab6e9a4fcc53
    09/20/2012 09:21:00.36 w3wp.exe (0x1F7C)                      
    0x1138
    SharePoint Foundation         Runtime                      
    tkau Unexpected
    Microsoft.SharePoint.SPException: The user or users have been added successfully, but there was an error in sending the e-mail message. The server may not be set up correctly to send e-mail. To verify that e-mail is configured correctly, contact your
    server administrator.    at Microsoft.SharePoint.ApplicationPages.AclInv.SendEmailInvitation(EntityEditor picker, String subject, String message)     at Microsoft.SharePoint.ApplicationPages.AclInv.BtnOK_Click(Object sender, EventArgs e)
        at System.Web.UI.WebControls.Button.OnClick(EventArgs e)     at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)     at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String
    eventArgument)     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStage...
    df98555c-612f-4a58-9443-ab6e9a4fcc53
    The e-mail address I have tested it for several times and there is no problem.
    Anyone has any clue about this error?

    Hi.
    This I have seen before...
    It can be that the SMTP relay server is configured to only allow certain IP ranges or addresses.
    It can be that the firewall on the SP server does not allow for SMTP traffic (normally 25, for example for Exchange).
    It can be that there is an Antivirus on the SP server(Client AV) that prohobits the Timer service to send email from this server. I have seen MacAfee do this. Needed an policy change.
    If, its the builtin SMTP service you are using, check this link:
    http://blog.sharepointrx.com/2010/11/18/setting-up-the-iis-smtp-server-for-sending-email-from-sharepoint-2010-on-server-2008-r2/
    Check that and try again.
    Regards
    Thomas Balkeståhl - Technical Specialist - SharePoint -
    http://blog.blksthl.com
    Download the SharePoint Branding Project here
    Download the SharePoint 2010 Site Settings Explained here

  • TS3899 I send an e-mail message from my iPhone 5c and it shows up in Sent folder as a duplicate, 2 of the same e-mail messages sent at the same time.

    I send an e-mail message from my iPhone 5c and it shows up in Sent folder as a duplicate message. 2 identical messages sent at the same time. What's up with this? Tried Apple Support by phone, and did a couple of troubleshoots, then my connection with Apple Support was cut off. Issue not resolved yet.

    Did the mail get sent? Is the only issue the fact that it appears twice in the Sent folder?

  • Schedule the sending of a mail message

    Hi everyone
    How can I schedule a sending of a mail message? It seems so simple and so used in other mail programs... it's as simple as creating a mail message and ordering it to be sent first think in the morning while I'm still sleeping... that's what computers should be for right?
    Couldn't figure it out with automator...
    Tips and tricks are appreciated
    best regardzzzZz
    CV

    There is a script for it in Andreas Amann's Mailscripts
    AK

  • Why I can't send any e-mail messages with 6230i?

    Hi mates,
    I have a Nokia 6230i with a Vodafone Italian sim card in it.
    I know for sure that I CAN retrieve messages form my incoming POP3 e-mail server but I can't send any e-mail messages with it.
    Any time I try to do that it prompts me an information balloon saying: message failed. Why??
    I mean, I properly set up my phone with all Vodafone details but it still does not seem to work.
    Any help will be appreciate
    Stefano.
    P.S.
    I can even send and receive MMS and of course SMS too
    Solved!
    Go to Solution.

    thanks mate for your reply
    When you say: "Make sure your SP allows sending e-mail"
    Do you mean the provider who give me the mail service?
    Because I know for sure that with MS Outlook express I can send and recive e-mail with it
    Bye,
    Stefano.

  • Tried setting up my verizon e-mail account on iPod Touch, 4th generation. Am able to send out e-mail messages but none of my e-mails on my Mac show up in the inbox. Just get the "Checking for Mail" endlessly.

    Tried setting up my verizon e-mail account on iPod Touch, 4th generation. Am able to send out e-mail messages but none of my e-mails on my Mac show up in the inbox. Just get the "Checking for Mail" endlessly.

    On the iOS array of devices, you need to make sure all of the settings are right. I have found an official Verizon webpage for setting it up on Apple devices right here:
    http://support.verizonwireless.com/clc/devices/knowledge_base.html?id=39930
    Hope this helped!

  • How can I find an e-mail sent in October...I only see November Sent e-mails in my Sent folder?

    How can I find an e-mail sent in October...I only see November Sent e-mails in my Sent folder?

    Simply enter the configurations menu from settings, go to personal config and the account should be listed there, select options and delete.
    Simple! :-)
    iPhone 5 32GB
    MacBook Pro Retina 15" Mac OS X Mountain Lion 10.8.4

  • Sending and saving mail message with .msg extension

    How can I save the mail message when sending with .msg extension , so that when user click on the saved message it will open in OutLook Express. ?

    I already tried the one u suggest , MimeMessage has a method
    writeTo(OutputStream) which can be used to save the message with .msg extension .... But the main problem arises when trying to open it in OutLook .....
    It gives some error .... I think that it may be because of format .. .msg has binary format while MimeMessage is in another format ....
    is there any way to convert MimeMessage to binary and then save it in .msg file .

  • HT2488 How do I create an iCal Alarm to delay send an e-mail in my Drafts folder of Mail?

    I've learned how to use iCal Alarm to schedule sending an e-mail.  However, all of the instructions I read say that I have to type the e-mail inside the automator's "New Mail Message". Is there a way to type the message in Mail, save it in drafts, and then create an iCal Alarm to schedule sending it?
    I got as far as "Get Specified Mail Items" --> "Display Mail Messages".  This sequence displayed a message in Drafts.  What next to get it to send that message it displayed?  I tried adding "Send Outgoing Message" to the sequence with no success.  And I tried adding "New Mail Message" --> "Send Outgoing Message" to the sequence with no success.
    Sometimes there will be several e-mails I want to delay send (some that I started earlier in the day, saved in Drafts and finished up in the wee hours of the morning) and it seems a waste to have to create a new iCal Alarm for each. 
    Thank you!

    I've learned how to use iCal Alarm to schedule sending an e-mail.  However, all of the instructions I read say that I have to type the e-mail inside the automator's "New Mail Message". Is there a way to type the message in Mail, save it in drafts, and then create an iCal Alarm to schedule sending it?
    I got as far as "Get Specified Mail Items" --> "Display Mail Messages".  This sequence displayed a message in Drafts.  What next to get it to send that message it displayed?  I tried adding "Send Outgoing Message" to the sequence with no success.  And I tried adding "New Mail Message" --> "Send Outgoing Message" to the sequence with no success.
    Sometimes there will be several e-mails I want to delay send (some that I started earlier in the day, saved in Drafts and finished up in the wee hours of the morning) and it seems a waste to have to create a new iCal Alarm for each. 
    Thank you!

  • Mail won't automatically apply rules to messages in "sent" folder

    The title says it all. Is this a bug? Mail lets you set rules for items in the "sent" folder, but apple won't automatically apply the rules like it will for all other mail. You must highlight your "sent" messages and click "apply rules." This is quite annoying. Am I missing something.
    Thanks,
    Jake

    Once you send an e-mail it gets time stamped, from what I know this timestamp can't be modified. I too have received e-mails with the wrong timestamp. In some mail clients such as Yahoo Mail and Gmail what will happen is that you will get a new message notification but the email won't be at the top of the inbox but rather somewhere down the list. This happens as e-mails are sorted by their timestamps when they arrive to your inbox.
    Hope this helps!

  • Duplicate Messages in Sent Folder--Apple mail and gmail

    I recently started using apple mail for my two gmail accounts.
    I have properly configured all folders (highlight "trash" from gmail and click use this mailbox for..)
    since i have two gmail accounts, i did this for both of them.
    i did a couple of test emails from my main gmail account. now, in my sent folder it's showing duplicates for what i've sent, one from my main gmail account, one from my second gmail account.
    I've tried to uncheck the box where it saves messages on server in preferences, and that seemed to work. however, i checked on my iphone and my sent message showed up..not in my main gmail account sent mail, but in my secondary gmail account sent mail.
    can this be fixed?

    check out the settings here: http://mail.google.com/support/bin/answer.py?answer=78892#
    specifically:
    From the Mail menu, click Preferences > Accounts > Mailbox Behaviors
    Drafts:
    Store draft messages on the server > do NOT check
    Sent:
    Store sent messages on the server > do NOT check
    Junk:
    Store junk messages on the server > checked
    Delete junk messages when > Never
    Trash:
    Move deleted messages to the Trash mailbox > do NOT check
    Store deleted messages on the server > do NOT check

  • CFMAIL -- How to send an e-mail to a network folder

    Guys,
    I am using Cold Fusion 7.0 and I have the functionality in the website where an e-mail is generated (i.e based on some changes or actions) and that e-mail goes to a folder in the Outlook right now.
    Instead of sending the email (which is generated through the website) to the outlook, I need to send it to a folder on network drive (ex: G/Emails).
    Is this possible, if so could you please help me out how to achive this.?
    Thanks

    Have a look at <cffile>: http://livedocs.adobe.com/coldfusion/7/htmldocs/00000254.htm
    Bear in mind that by default the CF server which will be doing the file oepration runs on the local system account which will not have access to any network resources, so you will have to start the CF service with an account that does have permissions to the resources in question.
    Also not that your reference to G: is probably just something your login script maps for you when you login to your desktop... the CF server probably isn't going to have a G: drive, so you will need to access the other server's file system via a UNC, eg: \\otherserver\share\path\to\directory
    Adam

  • Apple Mail and the "sent messages" verus "sent" folder

    I have a Mac Pro and a MacBook Pro, both running Snow Leopard with all the latest patches.
    In mail, in what appears to be the same mail configuration and the same account, I have sent messages being stored in a "sent messages" folder on the IMAP server and the other is storing it a "sent" folder.
    I can't seem to find a way to get them both to use the same folder and I don't see that in the "Mailbox behavior" tab.
    Any ideas how to get them to use the same folder?

    Where is the Sent Messages folder listed? If it is not under MAILBOXES but in an IMAP folder, select it and go to Mailbox menu, Use this mailbox for>Sent.
    It should disappear and sent messages then appear in the Sent folder.

  • Apex_mail.send, keep sent messages in sent folder.

    Hey guys,
    I am trying to send email from APEX using apex_mail.send, it works fine but when I am trying to show up them in the sent folder from gmail site of the "FROM" email that I sent the message from, I can't find them there.
    Can you guys help in this?
    Please let me know if any questions.
    Thanks
    Mohannad

    Mohannad wrote:
    Hey guys,
    I am trying to send email from APEX using apex_mail.send, it works fine but when I am trying to show up them in the sent folder from gmail site of the "FROM" email that I sent the message from, I can't find them there.Which appears to indicate that APEX is not configured to use GMail as the SMTP server. What are the SMTP settings for the APEX instance?

  • After importing received and set messages from Opera Mail, Thunderbird works fine but does not save sent messages to Sent folder, even though messages are sent

    I successfully imported messages from Opera Mail. Initially the Sent mailbox was not showing in Thunderbird. A quick removal and fresh installation solved that, but Thunderbird does not save the sent messages to the Sent box, where the imported Opera Mail messages are stored. Even though messages are not saved, they are sent correctly. The image attached shows the error message.

    Probably a name-confuse If you store sent on mailserver it has to have the right name. (subscribe)
    You could set up under Account settings / copies and folders (maps) Sent pointing to the right local folder.

Maybe you are looking for