JavaMail - send mail on a specific date

Is it possible to send a mail on a particular date? Does JavaMail support this option?
My application has to send a mail to the recipients 24 hours after the user press the "send" button. I searched the forum and the only solution I found was to use threads. This solution isn't good for me (since the user can shutdown his computer during this time).
Does anyone know another solution? or has another idear?

I do not know of any feature in the e-mail protocol (not just Java's implementation of it) that would support this.
However, instead of sending the e-mail from the client, could you just send a request to a server and have the server send all e-mails when they are due? There would still be the problem of the server being down and any delay in the actual routing of the message but these issues will probably always exist due to the design.

Similar Messages

  • Send mail at a specific time?

    Is there any way with mail that I can write and email and then have the program send it at a specific time or date?
    Thanks.

    Anyone?

  • Can JavaMail send mail to Lotus Notes?

    Can JavaMail send e-mail to Lotus Notes?
    If I can't, is there any alternative method?
    I need it for my J2EE project.
    Thanks!!
    Dan. :)

    Cann you explain how?
    Can you put an example?
    Thanks in advance.

  • Finding all SharePoint objects (alerts, workflows, etc) configured to send mail to a specific user

    Hi all,
    I'm looking at the mail traffic originating from our SharePoint instance and noticed there are a number of "delivery has failed to these recipients or groups" for people no longer with us.
    Is there a means (powershell?) to discover the objects (alerts, workflows, etc...) in SharePoint that are sending mail to these people so they can be removed as part of old account housekeeping?
    Thanks!
    Paul

    Hi
    Please checkout below script to remove the alerts enabled for individual users.
    http://dunxd.com/2010/12/22/delete-all-alerts-for-a-user-in-sharepoint-with-this-powershell-script/
     You can verify the content of emails which will have names of users  and kind of emails , if that is aa workflow approval or simple alerts.  if its workflow alert you might need to contact the sharepoint administrator/designer who can find
    out the source of same
    regards Puran Mishra

  • Send e-mail automatically at specific date

    I need to send an e-mail to everyone automatically at their birthday. I am handling the SQL Server database through a winform C#. I need something that triggers an e-mail when the date associated with the e-mail address is the same as the server's time.
    Is there a way to do that? An example of code would be very appreciated!

    Hi,
    Refer below links.
    Configure Database Mail – Send Email From SQL Database
    Schedule a Job
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    Praveen Dsa | MCITP - Database Administrator 2008 |
    My Blog | My Page

  • Unable to Send Mail to a Specific Domain

    I've searched the forum but found no answers.
    I have a new iMac and a MacBook, both running 10.5.1
    The email settings are identical on both computers (I checked many times over).
    I can send an received mail on the MacBook, but can only receive email on the iMac.
    Well - SOMETIMES, it will send email on the iMac. The majority of the time I get the message where I can select another outgoing email server (I have only 1) - I use the connection test, and everything shows OK. What gives??
    UPDATE:
    After some trial and error - I am finding that I cannot email to people with a certain domain. For example, My ISP is Cox.net (and so is my email) - and I cannot email to myself or anyone @cox.net. I can email out to people with Gmail email address though. I am confused even more now...
    I have no one in my address book. Is it possible that some sort of corruption has occurred related to certain email addresses? If so, how would that be fixed?
    ANOTHER UPDATE:
    I found that if I select "remove from previous recipients list" for my own email address, I was able to send an email to myself.

    On my MacBook (10.5.1) the port setting is in Preferences>Accounts>Advanced. It's grayed out on mine, why I don't know. I migrated settings from my iMac (running Tiger) when I bought it, and haven't tinkered with it at all. My settings also include password authentication. As I said, I've used it at a several airport lounges overseas, without any problems.

  • Send mail to a specific user group when an Inbound Idoc processing fails

    I am using standard Message type DEBMAS, but the process code is customed (say ZDEBM as the function module is customed). Can you tell me what configurations are required to activate the error notification message to a user when the inbound idoc fails?

    hi,
    i think u need to check tcode swu3 for automatic workflow customizing and check in we40 (error AND STATUS PROCESSING) whether the processing code is assigned to the workflow task.
    if it is assigned,the workflow will be automatically triggered and the mail will be sent to the user by itself.
    ALE error handling uses workflow. A standard task is provided for each message type. Task TS20000051 is used for all BAPIs.
    Workflow functions as follows:
    A task (work item) is generated for the error handling and stored as a message in the inboxes of the employees responsible.
    If one of these employees processes the work item, the standard task method for error handling is started. The user can, for example, restart IDoc processing.
    If the IDoc is processed successfully, the work item is deleted from the inboxes of all the employees involved.
    For this procedure to function, the employees responsible for a particular message type and partner (sender or receiver) must be defined as follows:
    1. A hierarchy of organizational units (for example, "sales office") and positions (for example, "customer officer for customer X") is created and employees are assigned to it.
    2. The standard tasks for error handling (for example, an error related to an inbound sales order) are assigned to the relevant organizational units or positions (for example, "sales office").
    3. The organizational unit, position or employee responsible for dealing with the error are specified for each partner and message type in the partner profiles.
    If an error occurs, the system determines:
    1. The employees responsible using the staffing schedule of the organizational unit or position linked to the standard task.
    2. The employees defined in the partner profiles (using position, user ID, or organizational unit).
    3. The employees appearing in both groups represent those who will receive a work item in their inboxes.
    regards,
    pankaj singh

  • Send mail on specific date and time

    Does anyone know how can I tell Mail to send a mail on a specific date and time?

    Mail won't do it by itself, but iCal will. Create an event at the specific date and time you want the mail sent. You will then need to create a simple applescript to send the desired email content to the desired recipient. Then instruct iCal to 'run script' at the desired time.
    Check out the applescript forum here on Apple Discussions for help with the applescript.
    It will be a FUN learning experience!

  • After delay I can't able to send Mail in Workflow

    After Maintaining delay in Sequential Workflow I can't able to send mail,
    Please suggest anyone.
    Regards,
    Siva Krishna

    You have to use a 'Pause Until' condition in your case to send out mails
    links - http://stackoverflow.com/questions/18626235/sharepoint-workflow-to-send-email-on-a-specific-date-and-time
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • Unable to send mail to some addresses after move to Leopard

    I am not sure, whether I am in the right forum with my question. If not, please tell me where I should go.
    I am traveling a lot for work and have clients in many countries. Since 2004, I have been using Mac laptops and have not encountered any problems sending mail through clients' LANs, from my own place to clients, or from any number of hotels to clients. I migrated from Tiger to Leopard on the day the latter OS became available.
    Since the move, I am experiencing a problem sending mail to one specific client. I can no longer send mail to my various contacts within that client's premises (all of whom share the same domain name) from outside. I also cannot send mail to any of those contacts when I am hooked up to the client's network (but not the domain) whilst within the client's premises.
    I use Mail and a mac.com address. I do not use web-mail. It is further noteworthy that messages from my side without attachments will sometimes (perhaps 20% of the time) go through. However, messages with attachments never go through. I have discussed the matter at length with the two IT-experts at the client (a government office) and we have not been able to come up with suggestions.
    Since I am now forced to use a USB-stick to exchange info with my client, I would much welcome your suggestions as to the cause of the problem and possible solutions. Many thanks in advance.

    Thank you for taking up the issue, Type17. The mails do not disappear, they remain in my outbox (on my Mac). The intended recipient does not get a message. I, for my part, see a box with the message 'Cannot send the message using the server 'smtp.mac.com: myloginname'. The server name is highlighted in blue in a box below and I get the choices: 'Edit message', 'Try later' and 'Try with selected server'. None of these resolves the problem. The last option, i.e. 'Try with selected server', is a bit strange, because pressing the button 'Edit server list', shows only the server already mentioned. I have tried 'Connection doctor' several times over the past months, but this consistently gives me a green light against the smtp and the message: 'Connection and login to server successful'.

  • I need to send email in future specific day how can i do this ?

    If someone can helps thanks alot.

    Hi,
    You go for following approach :-
    1. Maintain a table with contains all date when you need to send mail. it can be one date or many.
    2. create a custom program which will first read this table above and see if todays date does exist in table.. if yes it will send mail else not.
    3. Now schedule report on daily basis. 
    Thats it. When ever you want to send mails just enter those dates in this table. it can be any no of future dates.
    Hope this helps.
    Enjoy SAP.
    Pankaj Singh.

  • Alert not sending mail even if executed successfully.

    hi all,
    I have created alert in R12 environment. it is periodic alert which will fire everyday.
    There are 2 actions
    1. Run the Concurrent program and insert values emp_no,emp_name,manager_name,manager_mail into custom table.
    2. Send mail to manager_mail containing data like emp_no and emp_name.
    I encapsulated both the action in one action set. Sequencing 1. Concurrent Program ( Detail Level) 2. Send mail (detail level)
    When i am executing alert, it is ending with completed successfully. It is inserting data into custom table but it is not sending mail to manager mail id.
    When i tried to check history, it is showing 'n' number of exceptions, but all those exception are not available in FIND EXCEPTION tab.
    I m not able to find out, what exactly wrong i have done.
    Query is:
    Select emp_no,emp_name,manager_name,manager_mail into
    &l_emp_no,&emp_name,l_manager_name,l_manager_mail from xx_alert_table_data;
    and I am passing &l_manager_mail into 'To' section of send_mail action. it is not containing any null data. all the email address are present in that field.
    please suggest if i m doing anything wrong.

    Just putting the data into tables is not the actual process, performing the connection to the email server and sending email.
    Underneath it's a multilayered process .
    Oracle Alert uses Oracle Workflow Notification mailer for sending requests, which in turn uses mailer program to send mails.
    So, you need first to check the state of Notification mailer then locate logs of the mailer utulity used by these and see whether there were any connection/negotiation errors and what information in header fields has been actually sent.
    To see notification mailer program status change responsibility to Workflow Manager, then go to "Service Components" section and find there Workflow Notification process.
    To find the mailer type, change responsibility to Alert Manager, then go to System->Options and see which mailer is in use.
    Usually on Unix, sendmail is used, so you may easily turn on debug logging and see the mail headers and complete negitiation logs, if you need them.

  • Sending Messages at a Specific Time?

    Does anyone know if there's a way to keep outgoing messages in your Outbox and not send them immeadietly without Saving for Later?
    Sometimes I'll write an email late at night, but don't want it to send until say 8 a.m. Is there a way to set the message not to send until then or to tell the outbox to send mail at a specific time?
    Perhaps a way to set Automator to send the messages at a speciifc time?
    MacPro   Mac OS X (10.4.8)  

    I laughed because I found the Mail Scripts, and was just about to reply, when I saw that you had posted the answer already, Austin! I'm glad I know about those scripts--they'd be useful for many people who use Mail.
    Well, there you go, bdiesel, question fully answered!
    All the best.
    Power Mac G5 1.8GHz DP, 1.5GB RAM   Mac OS X (10.4.8)  

  • Getting error while sending mail through javamail api

    I can able to compile the following code successfully but while executing it showing the error
    C:\Program Files\Java\javamail-1.4\demo>java msgsend -o [email protected] -M 203.112.158.188 [email protected]
    Exception in thread "main" java.lang.NoClassDefFoundError: msgsend
    import java.io.*;
    import java.net.InetAddress;
    import java.util.Properties;
    import java.util.Date;
    import javax.mail.*;
    import javax.mail.internet.*;
    public class msgsend {
    public static void main(String[] argv) {
         String to, subject = null, from = null,
              cc = null, bcc = null, url = null;
         String mailhost = "null";
         String mailer = "msgsend";
         String file = null;
         String protocol = null, host = null, user = null, password = null;
         String record = null;     // name of folder in which to record mail
         boolean debug = false;
         BufferedReader in =
                   new BufferedReader(new InputStreamReader(System.in));
         int optind;
         for (optind = 0; optind < argv.length; optind++) {
         if (argv[optind].equals("-T")) {
              protocol = argv[++optind];
         } else if (argv[optind].equals("-H")) {
              host = argv[++optind];
         } else if (argv[optind].equals("-U")) {
              user = argv[++optind];
         } else if (argv[optind].equals("-P")) {
              password = argv[++optind];
         } else if (argv[optind].equals("-M")) {
              mailhost = argv[++optind];
         } else if (argv[optind].equals("-f")) {
              record = argv[++optind];
         } else if (argv[optind].equals("-a")) {
              file = argv[++optind];
         } else if (argv[optind].equals("-s")) {
              subject = argv[++optind];
         } else if (argv[optind].equals("-o")) { // originator
              from = argv[++optind];
         } else if (argv[optind].equals("-c")) {
              cc = argv[++optind];
         } else if (argv[optind].equals("-b")) {
              bcc = argv[++optind];
         } else if (argv[optind].equals("-L")) {
              url = argv[++optind];
         } else if (argv[optind].equals("-d")) {
              debug = true;
         } else if (argv[optind].equals("--")) {
              optind++;
              break;
         } else if (argv[optind].startsWith("-")) {
              System.out.println(
    "Usage: msgsend [[-L store-url] | [-T prot] [-H host] [-U user] [-P passwd]]");
              System.out.println(
    "\t[-s subject] [-o from-address] [-c cc-addresses] [-b bcc-addresses]");
              System.out.println(
    "\t[-f record-mailbox] [-M transport-host] [-a attach-file] [-d] [address]");
              System.exit(1);
         } else {
              break;
         try {
         if (optind < argv.length) {
              // XXX - concatenate all remaining arguments
              to = argv[optind];
              System.out.println("To: " + to);
         } else {
              System.out.print("To: ");
              System.out.flush();
              to = in.readLine();
         if (subject == null) {
              System.out.print("Subject: ");
              System.out.flush();
              subject = in.readLine();
         } else {
              System.out.println("Subject: " + subject);
         Properties props = System.getProperties();
         // XXX - could use Session.getTransport() and Transport.connect()
         // XXX - assume we're using SMTP
         if (mailhost != null)
              props.put("mail.smtp.host", mailhost);
         // Get a Session object
         Session session = Session.getInstance(props, null);
         if (debug)
              session.setDebug(true);
         // construct the message
         Message msg = new MimeMessage(session);
         if (from != null)
              msg.setFrom(new InternetAddress(from));
         else
              msg.setFrom();
         msg.setRecipients(Message.RecipientType.TO,
                             InternetAddress.parse(to, false));
         if (cc != null)
              msg.setRecipients(Message.RecipientType.CC,
                             InternetAddress.parse(cc, false));
         if (bcc != null)
              msg.setRecipients(Message.RecipientType.BCC,
                             InternetAddress.parse(bcc, false));
         msg.setSubject(subject);
         String text = collect(in);
         if (file != null) {
              // Attach the specified file.
              // We need a multipart message to hold the attachment.
              MimeBodyPart mbp1 = new MimeBodyPart();
              mbp1.setText(text);
              MimeBodyPart mbp2 = new MimeBodyPart();
              mbp2.attachFile(file);
              MimeMultipart mp = new MimeMultipart();
              mp.addBodyPart(mbp1);
              mp.addBodyPart(mbp2);
              msg.setContent(mp);
         } else {
              // If the desired charset is known, you can use
              // setText(text, charset)
              msg.setText(text);
         msg.setHeader("X-Mailer", mailer);
         msg.setSentDate(new Date());
         // send the thing off
         Transport.send(msg);
         System.out.println("\nMail was sent successfully.");
         // Keep a copy, if requested.
         if (record != null) {
              // Get a Store object
              Store store = null;
              if (url != null) {
              URLName urln = new URLName(url);
              store = session.getStore(urln);
              store.connect();
              } else {
              if (protocol != null)          
                   store = session.getStore(protocol);
              else
                   store = session.getStore();
              // Connect
              if (host != null || user != null || password != null)
                   store.connect(host, user, password);
              else
                   store.connect();
              // Get record Folder. Create if it does not exist.
              Folder folder = store.getFolder(record);
              if (folder == null) {
              System.err.println("Can't get record folder.");
              System.exit(1);
              if (!folder.exists())
              folder.create(Folder.HOLDS_MESSAGES);
              Message[] msgs = new Message[1];
              msgs[0] = msg;
              folder.appendMessages(msgs);
              System.out.println("Mail was recorded successfully.");
         } catch (Exception e) {
         e.printStackTrace();
    public static String collect(BufferedReader in) throws IOException {
         String line;
         StringBuffer sb = new StringBuffer();
         while ((line = in.readLine()) != null) {
         sb.append(line);
         sb.append("\n");
         return sb.toString();
    So please help me to resolve that error.

    The directory that contains msgsend.class (usually the current directory)
    is not in your CLASSPATH setting. Be sure that "." is included as one of the
    entries in CLASSPATH.

  • How to send a mail on a particular date

    hello everybody.
    i am developing a greeting site.
    where in i need to send a mail on a particular date, which is greater than today. how can i send mail on a pre selected date.
    my server is IIS and i am using java servlets and java mail api.
    please tell me if anybody having the solution.
    or please mail me to [email protected]
    thank you
    sambareddy
    hyderabad

    As far as I know there is no method in JavaMail for sending a message on a particular date.
    However you can use the Java.util.Timer and java.util.TimerTask class to do this.
    In the class that you send your message from
    public class SendMessage extends TimerTask{
    public void run(){
    //send message here
    TimerTask implements Runnable so a thread can be created here.
    To call the thread:
    public class CallMessage{
    public static void mail(String args[]){
    SendMessage sm = new SendMessage();
    Timer timer = new Timer();
    timer.schedule(sm, 10000, 10000)
    //wait for 10 seconds and repeat in 10 seconds
    There are a number of different schedule methods available for whatever you need to do.
    Hope this helps!

Maybe you are looking for

  • Help CS3 isn't working correctly in my new computer

    I just bought a new computer...I had no choice..the other one was dying. I do basic photo editing, but I do it daily. I have loaded my CS 3 onto my new Asus, with Windows 7 and i5 processor. Before I bought I did a lot of asking of friends and comput

  • Installing Mysql on Solaris 10

    Ive installed Mysql on solaris 10 and when i try and start it up i get these errors...any help would be appricated... # more Felicia.err 051025 14:45:34 mysqld started InnoDB: The first specified data file ./ibdata1 did not exist: InnoDB: a new datab

  • Creating link in work item

    Hello, I have one requirement in which i need to give 2 options to the user in work item. Basically i need to give two links which will open some transaction in SAP. I thnink i can not give decision because it will not open any transaction directly.

  • Sound problems with tv tuner

    so i got the tv@nywhere master for my birthday and had some blips with the installation (like the computer restarting itself for no reason) but now it seems to be running okay. except for the fact that my sound cuts in and out constantly. it'll be fi

  • Timeout from OSB to Intalio

    Hi In my project, Intalio calles services hosted on OSB. The read timeout set in Intalio is 6 minutes (360 seconds). OSB calls backend and sends response back to Intalio server within 10 seconds. We logged both request and response payloads in OSB an