Send email to each message selected using applescript

Hi,
I have a script which will send a single email to a number of recipients but I wanted it to send individual emails to the selected messages. I also wanted the script to extract the first name from the sender field. The problem I've had with that is the sender field reads something like "Joe Blogs via PayPal" I'd be happy with "Joe Blogs" if I could remove the "via PayPal". I found a script to remove words from text
set replyName to {}
set replyNametext to ""
set replyName to "Joe Blogs via PayPal"
set haystack to replyName
set needle to " via PayPal"
set replacement to ""
search_replace(haystack, needle, replacement)
on search_replace(haystack, needle, replacement)
          set old_delimiters to AppleScript's text item delimiters
          set AppleScript's text item delimiters to needle
          set temp_list to every text item of haystack
          set AppleScript's text item delimiters to replacement
          set return_value to temp_list as text
          set AppleScript's text item delimiters to old_delimiters
          return return_value
end search_replace
But I can't get that to work in the main script.
This is my main script:
set thesenders to {}
set thesenderstext to ""
set replyName to {}
set replyName 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 reply to of (item i of themessage)))
                    set replyName to (extract name from (the reply to of (item i of themessage)))
                    if thesenders does not contain thesender then
                              set thesenders to {thesender}
                              set replyName to {replyName}
                    end if
          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
          set theSubject to "instructions"
          set theContent to "Dear " & replyName & ",
Thanks so much for your email. ...
Regards ..."
          set newMessage to make new outgoing message with properties {subject:theSubject, content:theContent, visible:true}
          set theAttachment1 to POSIX file "/Users/Jim/qrcode.13177607.png"
          set theAttachment2 to POSIX file "/Users/Jim/qrcode.13177658.png"
          set theAttachment3 to POSIX file "/Users/Jim/qrcode.13177665.png"
          tell newMessage
                    set visible to true
                    make new to recipient with properties {address:thesenderstext}
                    make new attachment with properties {file name:theAttachment1} at after the last paragraph
                    make new attachment with properties {file name:theAttachment2} at after the last paragraph
                    make new attachment with properties {file name:theAttachment3} at after the last paragraph
          end tell
          set toAddress to thesenders as rich text
          tell newMessage
                    make new to recipient with properties {address:toAddress}
                    --  send
          end tell
          activate
end tell
I realise this is probably a bit of a Frankenstein monster of a script which probably contains lots of redundant features but I'm a total novice to scripts. Please could you help.
Thanks.
Jim

Hi all,
We are also facing same issue.
The function ids:getUsersInGroup doesnt return value.
Even i imported identityservice.xsd and is_config .xsd and created variable using the *"users"* element of identityservice.xsd schema and assigned the value to this variable.
But Audit always says
*"XPath query string returns multiple nodes.*
*According to BPEL4WS spec 1.1 section 14.3, The assign activity part and query should not return multipe nodes.*
*Please check the BPEL source at line number "72" and verify the part and xpath query "*
Help me to resolve this issue.

Similar Messages

  • How to Send Emails for failed messages without using Alert

    Hi Experts,
    In our project, we need to trigger Emails for the failed messages in SXMB_MONI / Adapter Engine without using Alert Framewrok.
    Please let me know the below :
    1. Is this really possible to avoid Alert?
    2. If possible, then can we accomplish this by creating any PI Scenario? Please provide me some knowledge.
    3. Can we do it by writing any ABAP Code? If ABAP report can make it, then please provide me the code/ tables which will be needed. If any Blog/ Wiki is there, then please let me know the URLs. 
    Thanks,
    Nabendu.

    Hi Nabendu,
       If your customer asks for mails with specific text for message failure, tell that it is not possible. Because Message will go through several engines like Adapter Engine, Integration Engine, BPE. You can not generate mails for the message failures in all these areas with out standard alert mechanism. These are pure technical alerts which only PI people can understand, not business alerts.
    Example: assume your sender channel is unable to connect FTP Server, in this case you can not generate even though you will develop adapter module to generate alerts.
                            So for message validation only you can send mails not for message failures.
    thanks,
    madhu

  • I send out invoices via a package. This creates 300 open emails which requires individual sending. How am I able to send without opening each message?

    I send out monthly invoices and statements via an accounting package (as attachments). This creates 300+ open emails which requires that I switch to each open email and click send. How am I able to send without entering each message and pressing the send button?

    Thunderbird simply does not support the sending of mail from Third party applications. only the creation. This is a security feature that stops a virus spamming your address book.
    If you want automation, use windows live mail.

  • Cannot receive/send emails via Mail on Mac using 10.6.8, keeps asking for password, very frustrating. Any ideas please? Regards

    Cannot receive/send emails via Mail on Mac using 10.6.8, keeps asking for password, very frustrating. Any ideas please? Regards

    One more time, iCloud mail accounts are .me, .mac and .icloud. New ones are only .icloud.
    iCloud mail is a standard Imap account that can be used with any mail client in existence. But You are talking about the ability to automatically setup an iCloud account in mail, which did not exist until 10.7.2.
    You can use password or token authentification with iCloud mail (in Mail) it is your choice.
    Set the account manually, set it as Imap, use imap.mail.me.com (no P number) for the incoming email and smtp.mail.me.com as the outgoing server.
    The full settings (ports and security) are here. Use them and it will work, regardless of domain (mac, me and icloud addresses all use the same settings.
    IMAP (Incoming Mail Server) information:
    Server name: imap.mail.me.com
    SSL Required: Yes
    Port: 993
    Username: [email protected] (use your @me.com address from your iCloud account)
    Password: Your iCloud password
    SMTP (outgoing mail server) information:
    Server name: smtp.mail.me.com
    SSL Required: Yes
    Port: 587
    SMTP Authentication Required: Yes
    Username: [email protected] (use your @me.com address from your iCloud account)
    Password: Your iCloud password
    Note: If you receive errors using SSL, try using TLS instead. SSL is required for both IMAP and SMTP connection with iCloud. POP is not supported by iCloud. 
    For more information on how to use this information with your email application, consult your application's documentation.

  • How to send Email with Cc and Bcc using MailPackage

    Hi ,
    we are using Mail Package to send the Email using Mail Adapter.We have a requirement where we need to send Email with Cc and Bcc using Mail Package .
    Can we send Cc and Bcc using Mail Package ?
    Thanks
    Rajesh .

    HI Rajesh,
    There is a standard structure for Receiver Mail adopter which we can get from SAP market Place but it is not provided with CC if u want to use CC then you have to go with Dynamic Configuration.
    DynamicConfiguration configuration = (DynamicConfiguration) container.getTransformationParameters().getStreamTransformationConstants.DYNAMIC_CONFIGURATION);
    /*any other required fields*/
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/Mail", "THeaderCC");
    configuration.put(key, "ccemail @ test.com");
    Regards
    Praveen Reddy
    Edited by: Maareddy Praveen Reddy on Aug 10, 2011 12:17 PM

  • I am unable to send emails in one go. we used to do same thing using MS-Outlook quite easily. Hoping best reply

    In outlook after pressing send button it will directly goes into outbox and we can send another mail in the mean time but here in thunderbird we have to wait to send another mail until the previous mail has been sent.

    If you want to send immediately, you need to be in 'online' mode and the 'Send' button is available. Then click on 'Send' to send that email.
    However, your description sounds like you want to create several emails, store them in 'Outbox' and then send all in one go. In which case do not use 'Send' for obvious reasons.
    Instead use 'Send Later', then the email will be sent to the 'Outbox' where it will stay until you right click on 'Outbox' folder and choose 'Send unsent messages'.
    In a new Write message, in 'online' mode, the 'Send' button will be available. There is a small arrow to the right of 'Send' button, it displays a drop down selection which includes 'Send Later' option.
    'File' > 'Send Later' is also available.
    If you are in 'offline' mode then the 'Send' button is by default replaced by 'Send Later' button.
    'Offline' means Thunderbird is not using the internet, so cannot send an email, hence the 'Send Later' option is only available.
    You can swap between 'online' and 'offline'.
    When in 'Online' mode you will see two blue screen icons in bottom left of Status bar. Clicking on this icon will change to 'Offline' mode and show a two black screen icon. Click ing on that will take you back to 'online' mode.
    You do not have to be in 'offline' mode to use 'Send Later' option.

  • Function that would send email with body of select output

    Hello support,
    I want to create a function which would send an email of such type
    BEGIN
    flows_030100.wwv_flow_mail.send(
    p_subj => 'test'
    ,p_body => I WANT A SELECT OUTPUT HERE :)))
    ,p_from => 'sender@mail'
    ,p_to => 'recepient@mail'
    flows_030100.wwv_flow_mail.push_queue_background();
    END;
    I need a select output to be a body of an email.
    Thank you in advance.

    Hi,
    In our WMS system we use the demo_mail package to send emails when we get system errors, you can write content to the body within a cursor or for i in (select ....) loop
    conn                  utl_smtp.connection;
    begin
      conn := demo_mail.begin_mail(
        sender     => 'Helpdesk <[email protected]>',
        recipients => V_Recipients,
        subject    => 'A WMS error has occurred!',
        mime_type  => demo_mail.MULTIPART_MIME_TYPE);
      demo_mail.write_text(
        conn => conn,
        message => 'A system error has occurred at ' || I_Origin || ' while being operated by user ' || I_Username);
      utl_smtp.write_data(conn, utl_tcp.CRLF);
      utl_smtp.write_data(conn, utl_tcp.CRLF);
      demo_mail.write_text(
        conn => conn,
        message => 'The error details are: ' || I_Notes);
      for i in (SELECT STATEMENT HERE..) loop
        demo_mail.write_text(
          conn => conn,
          message => i.field_name;
          utl_smtp.write_data(conn, utl_tcp.CRLF);
      end loop;
      utl_smtp.write_data(conn, utl_tcp.CRLF);
      demo_mail.write_text(
        conn => conn,
        message => V_Insert_Error);
      demo_mail.end_mail( conn => conn );Hope this helps.
    Graham.

  • Sending emails for each record from tabular form

    I currently have a requirements management tabular form that used to update or set job requirements inactive and/or covered.
    We're a staffing agency and have salesmen across the country that will use this tabular form to quickly manage their requirements to mark them as covered or inactive if the position has been filled.
    The multi-row update works fine since the form was built using the wizard, but I need to be able to send out an email for each record that's been marked as covered in the tabular form.
    How can this be accomplished?
    I'm running Oracle 12c and Apex 4.2.0 on a windows 2008 R2 server.
    Thanks again.

    Greg,
    I took a different approach from what I originally suggested.  Since the tabular form is displaying only reqs that eligible to be covered, I chose to construct a process that would read the database after the reqs table was updated.  The code should find recent reqs covered by the salesman and then send out an email for each covered req.
    Since I cannot see the data structure of your reqs table, I guessed the data type and size for the local variables in the DECLARE section, you many need to adjust these.
    Give this code a shot and let's see where we get.  By the way, the naming conventions of your database are in need of naming standards.
    The process needs to occur After Submit and after the Automatic Row Processing (DML) process that is updating the reqs table.  Make sure that the process sequence number is greater than the Automatic Row Processing (DML) sequence number.
    DECLARE
       l_id           NUMBER;
       l_index        NUMBER;
       l_vc_arr2      apex_application_global.vc_arr2;
       lc_message     VARCHAR2 (4000);
       l_pkey         NUMBER;
       l_date_wrote   DATE;
       l_sales        VARCHAR2 (100);
       l_client       VARCHAR2 (100);
       l_job          VARCHAR2 (100);
       l_1or2         VARCHAR2 (100);
       l_rate         NUMBER;
       l_notes        VARCHAR2 (4000);
    BEGIN
       FOR c1
          -- Retrieve reqs primary key that have been covered
          -- in the last 2 seconds by the salesman
       IN (SELECT pkey
             INTO l_pkey
             FROM reqs
            WHERE     SYSDATE < (date_wrote + 1 / 46200)
                  AND active = 'Active'
                  AND reqs.sales = :p12_sales
                  AND covered IS NOT NULL)
       -- Send an email for each req that has been covered
       LOOP
          SELECT c1.date_wrote,
                 c1.sales,
                 c1.client,
                 c1.job,
                 c1.notes,
                 c1.who,
                 c1.1or2,
                 c1.rate
            INTO l_date_wrote,
                 l_sales,
                 l_client,
                 l_job,
                 l_notes,
                 l_who,
                 l_1or2,
                 l_rate
            FROM reqs
           WHERE pkey = l_pkey;
          lc_message := 'Date Written   :' || l_date_wrote || CHR (10);
          lc_message := lc_message || 'Sales          :' || l_sales || CHR (10);
          lc_message := lc_message || 'Client         :' || l_client || CHR (10);
          lc_message := lc_message || 'Position       :' || l_job || CHR (10);
          lc_message := lc_message || '#1 or #2       :' || l_1or2 || CHR (10);
          lc_message := lc_message || 'Rate           :' || l_rate || CHR (10);
          lc_message := lc_message || 'Notes      :' || l_notes || CHR (10);
          l_id :=
             apex_mail.send (
                p_to     => '[email protected]',
                p_from   => 'DO_NOT_REPLY@REQS',
                p_subj   =>    ''
                            || l_who
                            || ' Has Covered '
                            || l_job
                            || ' at '
                            || l_client
                            || CHR (10),
                p_body   => lc_message);
          COMMIT;
          apex_mail.push_queue ();
       END LOOP;
    END;
    Jeff

  • Cannot send email from bigpond account when using overseas telco network

    I am sure this question has been asked and answered before but I cannot find a definitive answer on this forum I am on the Telstra network locally but when I travel to Malaysia I use a local SIM card with data, as the rates are much cheaper than anything Telstra can matchI find I can receive emails on my bigpond email account but cannot send. Can someone from Telstra publish something in this forum or on the general Telstra help pages on what settings to use exactly so that you can send and receive emails from your bigpond account while using another network overseas. I have tried changing the outgoing mail server account to the local network provider's but I am still unable to send Thanks

    Hi Mazzi,
    When travelling overseas you can access your BigPond mailbox through an email program, or via the BigPond Webmailhttp://messaging.bigpond.com/inbox.do or http://webmail.bigpond.com/webedge/do/oldlogin. If you choose to use an email program, some settings will need to be adjusted, as mentioned below.
    While there are no 'perfect' settings which will work every time and from every country, it may as simple as adjusting the Authentication on the outgoing mail server.
    If you are accessing the internet via another Internet Service Provider (ISP), but want to send email through our outgoing mail server using your BigPond email address, then you must activate SMTP authentication. For the purposes of this, think of an 'SMTP (Simple Mail Transfer Protocol) server' as the outbound mail server.
    Make sure that you have adjusted the outgoing port settings as listed below, or configure your mail client so that it uses the service provider's SMTP server, with SMTP Authentication disabled. If you are uncertain on what this is, you can usually search for this online, or alternatively contact the service provider that is providing your internet access.
    If you are uncertain which mail platform you are on, you can confirm this by logging in here.
    The complete list of email settings (including IMAP for Outlook.com accounts) can be found here.
    Should you require immediate assistance while overseas, our BigPond Technical Support Team are available 24 hours, 7 days a week via Live Chat
     

  • Can't send emails through Nokia Messaging

    Hi
    Have been experimenting with Nokia Messaging for a week or so on my 5800XM, and I don't seem to be able to send emails at all.
    I have two email accounts - Hotmail and an ISP account (Eclipse). I can download emails OK from both. But when I try to send:
    1. The Eclipse account keeps asking for username & password - I have tried every combination of these I can think of, and nothing works. The mail I'm trying to send just sits in the Outbox "queuing".
    2. The Hotmail account apparently sends OK - the msg appears in the Sent Items list on the phone, and on my PC when I sync the account. But it never arrives. Have tried several "To" addresses but nothing ever arrives.
    Any ideas please ? An email client that doesn't send isn't a whole lot of use.
    Cheers & thanks in advance.

    Contacted Nokia Support about this, and their response rather stunned me:
    "In response to your concern, please be advised that Nokia and Orange have agreed on a partnership and  made Nokia Messaging available only to Orange subscribers. All Nokia Messaging users now have 30 days of free trial; however, once the 30 day free trial is over, customers must purchase Nokia Messaging subscription from Orange if they want to continue with the service. If you are under a contract with Orange and have unlimited data plan, we recommend that you contact them to have the Nokia Messaging enabled on your account. "
    When I installed it I did not see anything warning me that I had only a free trial and that it would thereafter be a paid service available only to Orange customers. I am not an Orange customer, so obviously I now have to bin this app and look for some other way to manage emails on my phone. All suggestions gratefully received !

  • Intermittent sending email- no error messages

    I have been battling an intermittent email sending issue for about 3 months and here's the scenario. We are using Thunderbird version: 31.5.0 generally with no issues, then without notice we will no longer be able to send emails reliably. I have tried to copy and paste the body of the email to a new email to try to see if that will send, Nope. I am in contact with my email service provider (iPage) trying to see if it is something on their end and in doing that I tried to send the source to a separate computer via a .TXT file and that wouldn't send either. In order to get it to send the source code to the other computer I had to copy and paste it to MS-Word and save it as a .DOC file format. But if we re-type the entire email message and try to re-send it will send with out any issues. Also, the unusual thing that we are seeing is that we are getting the message that the message was sent successfully and there are no errors when the failures are occurring.

    Ok if you are being notified the message was sent, that means your providers mail server is telling Thunderbird it got the message with no errors. What it does with it after that is anybodies guess. Except of course the ipage people they have the server and logs to work it out with.
    Being locked down to using DOC formats woulds like malware so it can piggy back out on the doc file. Have you run virus scans?
    Or it could be that the firewall at the providers end just does not accept TXT attachments. Not all that uncommon. But you would expect them to be able to tell you exactly what their mail rules were.

  • Unable to send emails via Nokia Messaging

    I have had the device for about 3 months and I have never had problems sending emails before, however over the last 3 days when I try and send an email it just sits in my outbox and then after a while it says failed.
    I receive emails fine so this is baffling me.
    I've noticed a similar problem was addressed however that is specific to getting an error 500 message and I don't get that. I tried the work through anyway but it still didn't solve the issue.
    Any help will be very much appreciated.
    Thanks
    LR

    chicaman wrote:
    have u fixed ur phone? Can u try uploading pictures via facebook plugin too? I think i got the same problem as u!
    hey man i have the same problem, i can't upload pictures on facebook for some reason, but it works perfectly on other wifis .
    and i remember having the same problem with my nokia messaging, here is what i did to fix it : delete the account from your phone, than go to emal.nokia.com, delete than radd your email accounts, than readd your nokia messaging account on your phones .
    Reality is wrong....dreams are for real... 2pac .
    don't forget to hit that green kudos

  • Cannot send emails on Q10 while traveling using wireless

    Q10 PROBLEM I am on Rogers wireless using a telus email address. The incoming server setting is Telus and out going is Rogers wireless, While in Canada I have no problem receiving and sending emails. When I travel I do not buy the data packages I rely on wireless connections and with the Q10 I am not able to send using wireless when I travel. I have tried changing the outgoing server to telus in those situations but it still will not send, In the last month I have tried it in Jamaica and in Vegas with the same results...will not send emails I receive fine. Other people must be having problems? Rogers has been useless directing me to a solution, Help.

    GregandhisQ10 wrote:
    Thanks again...... I will take another run at Rogers and see what happens. I am not sure I guess when you say hosted but I will ask that whan I speak to Rogers.
    You will know by virtue of the email address format. If it is @BB, @Rogers, @Telus (@Carrier), or something else that seems to point to either BlackBerry or a specific carrier, then indeed it is a hosted email account.
    GregandhisQ10 wrote:
    I have had the same email account at Telus for ever and all other BB devices I've had used the incoming and outgoing from Telus but this device will only work sending if I use the rogers outgoing server so I end up with a teuls incoming and a rogers outgoing
    I don't understand that at all then. If this is a hosted email account, I can see no way for it to ever function on any BB device other than a) a legacy BB device and b) a legacy device that is actually operating on the original carriers network. I have never heard of a hosted email account being directly usable (e.g., no forwarding involved) on any device for any other carrier. So perhaps this isn't hosted after all...but still, I have also never heard of any restriction to use the carriers outgoing SMTP server only.
    I believe that perhaps I do not actually understand your exact situation.
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Cannot send emails or add attachments when using hotmail

    Whenever I try to use firefox to send emails in hotmail, it doesn't work. Meaning, that when I hit the send button, nothing happens. Also, I am unable to upload attachments - the hyperlinks on that hotmail toolbar won't even highlight. I have updated to Silverlight 5.1.10411.0 - that didn't fix it, I have disabled Silverlight as well and that did nothing. I have version 13.0.1 of Firefox. Also "allowing" firefox.com in pop-up blocker as suggested in another thread didn't work either.

    You can try to reset Firefox.
    *https://support.mozilla.org/kb/reset-firefox-easily-fix-most-problems
    Reset creates a new profile and tries to import some settings from the old profile leaving the old profile intact.
    *https://support.mozilla.org/kb/Recovering+important+data+from+an+old+profile

  • Can't send email.  Get message saying server does not allow relaying.  I do receive email just can't send.

    WWhy can't I send email but can receive it.  I get the message that the server does not allow relay.

    Hello kathyfromfalcon,
    Welcome to the Apple Support Communities!
    I understand that you are unable to send email but are still receiving email. In this situation, with the relaying denied alert, I would suggest reading over the attached article and working through the steps provided.
    Get help with Mail on iPhone, iPad, and iPod touch - Apple Support
    Have a great day,
    Joe

Maybe you are looking for

  • Adobe Air HTML & JS Developing - Slow on massive Image-Tags

    Hello, I want to share a problem i noticed while developing an application with adobe air, based on the HTML & JS Stack, which uses multiple image-tags at the same time. I already mailed a bug but unfortunately did not get a bug number responded to r

  • No video/audio for MacBook

    Ever since I got a new MacBook (5 months ago), I've never been able to use iChat video or audio. My G5 w/ iSight works fine, and can video with my remote G4, but not with the MacBook. All systems are running latest X.4, and on routers/ISPs that do wo

  • Finding message in SAP Business Connector with IDoc number

    Hi Experts, Since there is no separate forum for Business Connector, posing my question here. Does anyone have idea how we can find a message in SAP Business Connector if we know the source IDoc number, the same way we use IDX5 in PI. Thanks, Dhawal

  • Iweb publishing to mobileme

    When I create a website in iweb '09 (3.0.1) and publish to mobileme, is there a way to have the website be hppt://mywebsitename.com or does it need to be http://web.me.com/mymobilemeaccountname/iweb/mywebsitename??

  • How to get oracle 9i blob column into an itab  in sap using Native SQL

    Hi , We are using SAP ECC 5.0  and we need to coonect to an oracle database ver 9i rel2. We need to get the data stored in a blob(pdf/jpeg) into an itab and later use it for futher processing. I am familiar with using native SQL and I wrote a stored