Applescript Help - Automatic Email Send to Group

Hey guys,
Me again. Ok, so I am starting to get the hang of this, learning more and more on applescripting. You guys have been a great help.
Now, I have a little applscript that I want to send an email automatically to a Group in my address book. However for the life of me, I can't figure out how to do that! Or is this just not possible? Please advise!
Here it is:
set theToRecipient to "My group" -- this would be the group name of email addresses that is in my address book
set theSubject to "The subject of the message"
set theContent to "the content of my message."
tell application "Mail"
  activate
          set newMessage to make new outgoing message with properties {subject:theSubject, content:theContent, visible:true}
          tell newMessage
  make new to recipient at end with properties {address:theToRecipient}
  send newMessage
          end tell
end tell
Appreciate all your help.

Try this --
set theToRecipient to {}
tell application "Address Book"
          if group "MyGroup" exists then
                         set theToRecipient to "MyGroup"
          end if
end tell
set theSubject to "The subject of the message"
set theContent to "the content of my message."
tell application "Mail"
  activate
          set newMessage to make new outgoing message with properties {subject:theSubject, content:theContent, visible:true}
          tell newMessage
  make new to recipient at end with properties {address:theToRecipient}
  --send newMessage
          end tell
end tell

Similar Messages

  • Automatic email sending

    Hi everybody! I created an hotmail account and use it on mail. Everyday my Mac sends automatic emails to my contacts with publicity of a site who sells Apple products. I've never seen that website before, so I don't understand why that happens....can you help me?
    Thanx a lot!

    Sounds like your Hotmail account has probably been hacked. Change your Hotmail password immediately. If that doesn't fix the problem, it's quite rare but possible for you to have some malware on your Mac that may behave this way... try a scan with [ClamXav|http://www.clamxav.com>.

  • Need help in EMAIL Sending -  more than 255 character length

    Hi Guys,
    Please help me in sending the Email attachment which has more than 255 character lengh using 'TXT format.
    if i create an internal table having a field of type char225.
    then break ur each record into many parts having len <= 255.
    how can i mingle both lines to single line in the output list.
    Please help me ..
    thanks in advance..
    Prabhu

    Hi,
    Check the following link:
    http://www.sap-img.com/abap/sending-email-with-attachment.htm
    Regards,
    Bhaskar

  • Automatic email send for new Blog or News item posts?

    Is there a way to send and automatic email to mailing lists when a Blog entry is posted (or, better yet, a News post)?

    Not within the system but you should be able to use Mailchimp's RSS to Email feature to do this automatically. http://mailchimp.com/features/rss-to-email/
    Having said that, if you don't have sufficient data from the RSS, you could use something like Kimono Labs to create your own RSS with the preferred data kimono : Learn

  • Need some help on email sending

    I'm not finding a solution for writing a correct code for sending an email through java program may be I have not done the list of what all I need I'm using netbeans So if any one can help me out its very much applauded.
    Regards
    Sreedhar

    but i cant understand from that error
    try this jsp file copy this code and paste it in jsp file and run it from browser
    <%@ page import="javax.activation.*,java.util.*,java.io.*,javax.mail.internet.*,javax.mail.*" %>
    <html>
    <head>
    <title>Send an email ans File with jsp page</title>
    </head>
    <body bgcolor="#C0C0C0" text="#CC0000" >
    <%
    if(request.getMethod().equals("POST")  )
      boolean status = true;
      // enter here the smtp mail server address
      // ask your ISP to get the proper name
      String mailServer = "192.168.0.1";
      String fromEmail    = request.getParameter("from");
      String toEmail      = request.getParameter("to");
      String messageEnter = request.getParameter("message");
      String fileName     = request.getParameter("theFile");
    try
        Properties props = new Properties();
        props.put("mail.smtp.host", mailServer);
        Session s = Session.getInstance(props,null);
        MimeMessage message = new MimeMessage(s);
        InternetAddress from = new InternetAddress(fromEmail);
        message.setFrom(from);
        InternetAddress to = new InternetAddress(toEmail);
        message.addRecipient(Message.RecipientType.TO, to);
        message.setSubject("Send Email with jsp");
        //message.setText(messageEnter);
        // Create the message part
        BodyPart messageBodyPart = new MimeBodyPart();
        // Fill the message
        messageBodyPart.setText(messageEnter);
           // Part two is attachment
        Multipart multipart = new MimeMultipart();
        messageBodyPart = new MimeBodyPart();
        DataSource source = new FileDataSource(fileName);
        messageBodyPart.setDataHandler(new DataHandler(source));
        messageBodyPart.setFileName(fileName);
        multipart.addBodyPart(messageBodyPart);
       // Put parts in message
       message.setContent(multipart);
       Transport.send(message);
    // ENCTYPE="multipart/form-data"
      catch (Exception e)
         System.out.println(e.getMessage() );
         out.println("ERROR, your message failed, reason is: " + e);
         status = false;
      if (status == true)
         out.println("Your message to " + toEmail + " was sent successfully!");
    else
    %>
    <h1>Send email and attatchment file with jsp</h1>
    <form method="post" name="mail" action="mail.jsp">
    <table BORDER="0">
    <tr>
        <td>To :</td>
        <td><input type="text" name="to" size=24></td>
    </tr>
    <p>
    <tr>
        <td>From :</td>
        <td><input type="text" name="from" size=24></td>
    </tr>
    <p>
    <tr>
        <td>Message :</td>
        <td><TEXTAREA name="message" ROWS = "5" COLS="65"></TEXTAREA></td>
    </tr>
    <p>
    <tr>
        <td>File attachment: </td>
        <td><input TYPE="FILE" name="theFile"></td>
    </tr>
    <tr>
         <td></td>
         <td><input TYPE="submit" value="submit" name="Command"></td>
    </tr>
    </table>
    </form>
    <%
    %>
    </body>
    </html>
    [\code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Automatic Email sending from SAP B1

    Hi All,
    I want to send one query result to particular email id on fix interval say daily at 10:00 AM.
    I have tried it through Alert but to my surprise it didn't send the external mail, where as the internal message works fine.
    What could be the reason of SAP B1 not sending the email ?
    TIA
    Hari Narayan

    Hi Jennifer Anderson ,
    I have configured Outlook Integration and now i am able to send the mails to any id(external or Internal) through send message window. But i want to do this through DI API. I am using message object but while I am sending the mail its asking for the USER code and Name. But the thing is that I want to send the mails to the external ids. Is it possible to send the mails to the nonuser like cutomers, vendors' ids. Is there any other way or object with the help of that I can send the external mails.

  • Plz help : "AUTOMATIC" Mail sending

    Hey Friends
    Please see the word "automatic", as soon as user enters a good receipt in MB01 or MIGO, an automatic mail should be send to [email protected] stating:
    Material # XXXX quantity XXX has been received into Plant XXXX (field WERKS) Storage Location XXXX (field LGORT) and the date received in.
    Please tell me how to do this as automatic.
    i have found that data is stored in the MSEG table, but how to use it so that and automatic mail is send.
    Thanks

    Hi,
    To send an email please use this sample code:
    * Declarations.
    PARAMETERS: p_email(50) LOWER CASE.
    DATA: document_data LIKE sodocchgi1.
    DATA: t_content LIKE STANDARD TABLE OF solisti1.
    DATA: s_content LIKE solisti1.
    DATA: t_receivers LIKE STANDARD TABLE OF somlreci1.
    DATA: s_receivers LIKE somlreci1.
    START-OF-SELECTION.
    * Receivers.
    s_receivers-receiver = p_email.
    s_receivers-rec_type = 'U'.
    s_receivers-express = 'X'.
    APPEND s_receivers TO t_receivers.
    * Subject
    document_data-obj_descr = 'New mail from Sap'.
    * Body
    s_content = 'Hi,'.
    APPEND s_content TO t_content.
    CLEAR: s_content.
    APPEND s_content TO t_content.
    s_content = 'Test email from sap, please don''t reply to this email'.
    APPEND s_content TO t_content.
    CLEAR: s_content.
    APPEND s_content TO t_content.
    s_content = 'Thanks,'.
    APPEND s_content TO t_content.
    s_content = 'Naren.'.
    APPEND s_content TO t_content.
    * Send the email.
    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
    EXPORTING
    document_data = document_data
    TABLES
    object_content = t_content
    receivers = t_receivers
    EXCEPTIONS
    too_many_receivers = 1
    document_not_sent = 2
    document_type_not_exist = 3
    operation_no_authorization = 4
    parameter_error = 5
    x_error = 6
    enqueue_error = 7
    OTHERS = 8.
    IF sy-subrc <> 0.
    MESSAGE e208(00) WITH 'Error in sending email :-(('.
    ELSE.
    MESSAGE s208(00) WITH 'Email sent :-))'.
    ENDIF.
    SUBMIT rsconn01 WITH mode = 'INT' AND RETURN.
    In order to do it automaticly either:
    - create program which will read a table and look for new entries and schedule it SM36
    - use workflow (configure event handling)
    Regards,
    Wojciech

  • HT2486 I am sending an email to a group which I have created in my contacts.  I would like to hide the list of people's emails but cannot see how I can do that.  Can anyone help please?

    I am trying to send an email to a group which I have created in my contacts.  I would like to hide the list of email addresses but cannot see how to do this.  Can anyone help please?

    Thank you for your message.  
    I can see how you do that when using the 'normal' emailing system from my mailing box, but not when working from the contact application (the 'book' on the bottom icon bar with the @ on it)....

  • I'm trying to send a group text but the recipient automatically defaults to send to their email.

    I'm trying to send a group text, but when I type in someones name, it automatically defaults to email.  It doesn't even give me the option to a choose phone number.  It only does with certain contacts.  Also, when a message doesn't go through, usually there is a red try again spot I can click, but when I click it, it only gives me the option to send as an email not text.

    99% chance you don't have the phone number in your contacts correctly.   Make sure there is an area code, etc.

  • Help!  I recently upgraded to OS 10.9.4 from 10.6.8, and now when I want to send an email to a group in my contacts I am no longer able to select the group as a whole.  I have to select each address individually.  This can't be right.

    Help!  I recently upgraded to OS 10.9.4 from 10.6.8, and now when I want to send an email to a group in my contacts I am no longer able to select the group as a whole.  I have to select each address individually.  This can't be right.  With 10.6.8 I used to be able to double click on the name of the group and they would all be selected.  I've also noticed that my address book is now called "contacts."  Thanks in advance for your help.

    Try these in order testing your system after each to see if it's back to normal:
    1. a. Resetting your Mac's PRAM and NVRAM
        b. Intel-based Macs: Resetting the System Management Controller (SMC)
    2. Restart the computer in Safe Mode, then restart again, normally. If this doesn't help, then:
         Boot to the Recovery HD: Restart the computer and after the chime press and hold down the
         COMMAND and R keys until the Utilities menu screen appears. Alternatively, restart the
         computer and after the chime press and hold down the OPTION key until the boot manager
         screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    3. Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the Utilities menu. Repair the Hard Drive and Permissions as follows.
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu. Select Restart from the Apple menu.
         Reinstall the 10.9.4 update: OS X Mavericks 10.9.4 Update (Combo).
    4. Reinstall Lion/Mountain Lion, Mavericks: Reboot from the Recovery HD. Select Reinstall Lion/Mountain Lion, Mavericks from the Utilities menu, and click on the Continue button.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.
         Reinstall the 10.9.4 update: OS X Mavericks 10.9.4 Update (Combo).

  • Help needed from manojpj regarding sending automatic emails

    HI manojpj,
    I saw your post in this forum regarding sending automatic emails.
    In my project also i want to send automatic emails and also want to retrieve emails automatically.
    i did retrieving and sending emails with user interaction.But i want to do automatically.In your post you told that your having code for sending automatic emails.
    can u please send me that code?
    Thanx a lot

    Dont hold your breath, there is a thread with hundreds of people asking for such code and no-one ever posted it.
    The easiest way is to use a cron job
    If you want to use Java instead of cron have a look at
    http://www.opensymphony.com/quartz/wikidocs/FAQ.html
    Its a java based job scheduler, you can use this to shedule your mails, or, as its open source, you can just take the code you need and add it to your esisting mailing code.

  • I recently updated to Lion and iCloud and am unable to send a group email for my blog using BCC.  When I try to do so, the email goes directly to draft.  Please help.

    How can I send a group email for my blog to using BCC on my mail program?

    Don't use bcc, use cc instead. Better yet create a new group in Address Book, put the contacts you want into the group, then when you email select the group in the To: field instead of putting in individual email addresses.

  • How to send a group email and have the recipients hidden?

    How do I send a group email and have the recipients hidden?

    I have a new OSX 27" iMac that is running Maverick. 
    RE: group emails, I am trying to omit individual recients and have tried the following options without success.
    1) Mail- Composing- checked "Automatically- Bcc"
    2) Mail- Composing- unchecked "when sending to a group, show all member addresses"
    The result is that all names continue to show up with email addresses for group emails.
    HELP!  HELP!  HELP!
    Lynn 

  • TS3276 how to send a group email with iPhone 5

    how to send a group email with iPhone 5

    I have a new OSX 27" iMac that is running Maverick. 
    RE: group emails, I am trying to omit individual recients and have tried the following options without success.
    1) Mail- Composing- checked "Automatically- Bcc"
    2) Mail- Composing- unchecked "when sending to a group, show all member addresses"
    The result is that all names continue to show up with email addresses for group emails.
    HELP!  HELP!  HELP!
    Lynn 

  • How can I send a group email to ensure privicy for recipients?

    I am trying to send a group email to all my address contacts that does not show any other of the group contact information on the email. Can anyone tell me how to do this effectivly. I receive loads of emails each day from corporate groups that do this to me so I see who else they sent the mail to but I don't know hoe to do it to my contacts. Help please....

    There is a potential security flaw in the BCC feature.
    According to the conventions of the SMTP protocol, all addresses, including BCC addresses, are included in every email as it is sent over the Internet. The BCC addresses are stripped off blind copy email only at the destination email server. Therefore, if the addressee controls their email server or can access it, they could examine the BCC addresses on every email they receive.
    Very occasionally, an email server will be misconfigured and not strip off the BCC list on email it sends to its local users, revealing the complete blind copy address field to users that receive the email at that domain. Therefore, BCC is very good but not perfect at keeping addresses confidential, and should not be relied on for the most critical and sensitive of communications.

Maybe you are looking for

  • We have one computer and two apple id's- how do I sync two phones to the same computer?

    My family has one laptop computer but we have two different iPhones and itunes accounts.  I want to be able to plug my iPhone into the computer and sync pictures and music with my account.  My husband has his own iTunes account and he needs to be abl

  • Install failure

    I updated iTunes and now it will not start. Gives me Error 7 Windows system error 193. I have downloaded fresh version of v 11.2.4 three times and attempted fresh install. I get this message: Service Apple Mobile Device failed to start. Verify that y

  • Safari has turned unusable: crash, crash, crash...

    Suddenly (soon after downloading the massive Apple's 09/28/07 update, which may or maynot be related), my Safari has turned unusable. It seems to be ok upon opening, but attempting surfing results in immediate crashing. First I encounter a Syndicatio

  • SQL Always On: not accessible for queries

    Hi forum! I'm monitoring SQL 2012 Always On Groups with the latest SQL MP. A couple of the database replicas are configured to not allow access. This is to avoid additional license costs for those minor important databases. However, I get the followi

  • Custom PCI Device Driver for Phar Lap

    Hi all, I have deployed Labview Real-Time to a compact-PCI card in a cPCI chassis (non-NI brand for several unavoidable reasons). I need to do high-speed communication with another card in the chassis at minimum rates of 20 MB/s read, 4MB/s write - b