IIneed code  to send  & receive mails  to MS OutLook Express using java

Hi Friends,
Please help me in the following area..
I need code to send and receive mails and attachments to MicoSoft OutLookExpress in java,
please give me the steps and entire code. Thanks In advance
Thanks & Regards
Kiran
[email protected]

Hi Masijade,
Thanks for your replay,
i found 1 solution at http://www.javacommerce.com/displaypage.jsp?name=javamail.sql&id=18274
but where he asked us to include class files from the follwing 2 links :
1. Javasoft's JavaMail class files which can be downloaded from
http://www.javasoft.com/products/javamail/index.html
2. JavaBeansTM Activation Framework extension or JAF (javax.activation). It is available at http://java.sun.com/beans/glasgow/jaf.html..
the problem is i am unable to download class files from 1st link. where i down loaded JAF1.1.1. jar file from 2nd link,
can you assist on this toppic please and where can we finf java mail class files.
Thanks & Regards
Kiran
[email protected]

Similar Messages

  • Complete code to send an attachment with a text message using java mailapi

    complete code to send an attachment with a text message using java mailapi
    code should be free from error

    http://java.sun.com/products/javamail/FAQ.html#examples
    Was this code too hard to find?
    Was the FAQ too hard to find?

  • How to send a mail by ckicking the button using java

    hi,
    how to send a mail by clicking the button (like payroll silp in that contain one button if we click that it autometically go through the mail as a attachment) pls frd to me my gmail is [email protected]

    Hi,
    It seems we are doing the homework for you; to make you start with something; look at the sample code below and try to understand it first then put the right values
    to send an email with an attachement.
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.util.Date;
    import java.util.Properties;
    import javax.activation.DataHandler;
    import javax.activation.FileDataSource;
    import javax.mail.Message;
    import javax.mail.MessagingException;
    import javax.mail.Multipart;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeBodyPart;
    import javax.mail.internet.MimeMessage;
    import javax.mail.internet.MimeMultipart;
    import javax.swing.AbstractAction;
    import javax.swing.Action;
    import javax.swing.JButton;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    import javax.swing.JTextField;
    public class Main {
          * @param args
         public static void main(String[] args) {
              // Create the frame
              String title = "Frame Title";
              JFrame frame = new JFrame(title);
              // Create a component to add to the frame
              JComponent comp = new JTextField();
              Action action = new AbstractAction("Button Label") {
                   // This method is called when the button is pressed
                   public void actionPerformed(ActionEvent evt) {
                        System.out.println("sending email with attachment");
                        sendEmail();
              // Create the button
              JButton button = new JButton(action);
              // Add the component to the frame's content pane;
              // by default, the content pane has a border layout
              frame.getContentPane().add(comp, BorderLayout.SOUTH);
              frame.getContentPane().add(button, BorderLayout.NORTH);
              // Show the frame
              int width = 300;
              int height = 300;
              frame.setSize(width, height);
              frame.setVisible(true);
         protected static void sendEmail() {
              String from = "me@localhost";
              String to = "me@localhost";
              String subject = "Important Message";
              String bodyText = "This is a important message with attachment";
              String filename = "c:\\tmp\\message.pdf";
              Properties properties = new Properties();
              properties.put("mail.stmp.host", "localhost");
              properties.put("mail.smtp.port", "25");
              Session session = Session.getDefaultInstance(properties, null);
              try {
                   MimeMessage message = new MimeMessage(session);
                   message.setFrom(new InternetAddress(from));
                   message.setRecipient(Message.RecipientType.TO, new InternetAddress(
                             to));
                   message.setSubject(subject);
                   message.setSentDate(new Date());
                   // Set the email message text.
                   MimeBodyPart messagePart = new MimeBodyPart();
                   messagePart.setText(bodyText);
                   // Set the email attachment file
                   MimeBodyPart attachmentPart = new MimeBodyPart();
                   FileDataSource fileDataSource = new FileDataSource(filename) {
                        @Override
                        public String getContentType() {
                             return "application/octet-stream";
                   attachmentPart.setDataHandler(new DataHandler(fileDataSource));
                   attachmentPart.setFileName(filename);
                   Multipart multipart = new MimeMultipart();
                   multipart.addBodyPart(messagePart);
                   multipart.addBodyPart(attachmentPart);
                   message.setContent(multipart);
                   Transport.send(message);
              } catch (MessagingException e) {
                   e.printStackTrace();
    }The sample above is not ideal so you need to go through it and start to ask me some questions if you have
    Let me know if you miss something
    Regards,
    Alan Mehio
    London,UK

  • Sample code to send a mail from SAP

    Hi guys
    could any one provide me with the
    sample code to send a mail from SAP with text as the main body of that mail via bcs classes

    Hi,
         Please go through this code: U can send mail;
    Tables : zchp_cust-info.
    DATA: OBJCONT LIKE SOLISTI1 OCCURS 5 WITH HEADER LINE.
    DATA: RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE.
    DATA: DOC_CHNG LIKE SODOCCHGI1.
    DATA: ENTRIES LIKE SY-TABIX.
    DATA: NAME(15).
    DATA: CON_NAME(20).
    DATA: req_num like zchp_cust_info.
    DATA: I_TAB_CHP LIKE ZCHP_CUST_INFO OCCURS 0 WITH HEADER LINE.
    *data: reno like ZCHP_CUST_INFO-req_num value .
    data input for the mail
    select * from zchp_cust_info
    appending table i_tab_chp where req_num = c_knumv.
    LOOP AT I_TAB_CHP.
    concatenate i_tab_chp-created_by i_tab_chp-req_num into CON_NAME.
    *WRITE: / con_name.
    ENDLOOP.
    Fill the document
    DOC_CHNG-OBJ_NAME = 'Refe'.
    DOC_CHNG-OBJ_DESCR = 'TESCRA Ref Number !'.
    DOC_CHNG-SENSITIVTY = 'P'.
    *OBJCONT = 'Tescra'.
    OBJCONT = CON_NAME.
    APPEND OBJCONT.
    OBJCONT = con_name.
    APPEND OBJCONT.
    DESCRIBE TABLE OBJCONT LINES ENTRIES.
    READ TABLE OBJCONT INDEX ENTRIES.
    DOC_CHNG-DOC_SIZE = ( ENTRIES - 1 ) * 255 + STRLEN( OBJCONT ).
    Fill the receiver list
    CLEAR RECLIST.
    RECLIST-RECEIVER = SY-UNAME.  " replace with <login name>
    RECLIST-REC_TYPE = 'B'.
    RECLIST-EXPRESS = 'X'.
    APPEND RECLIST.
    CLEAR RECLIST.
    RECLIST-RECEIVER = 'sapuser'.
    RECLIST-REC_TYPE = 'U'.
    APPEND RECLIST.
    Send the document
    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
         EXPORTING
              DOCUMENT_TYPE  = 'RAW'
              DOCUMENT_DATA  = DOC_CHNG
              PUT_IN_OUTBOX  = 'X'
         TABLES
              OBJECT_CONTENT = OBJCONT
              RECEIVERS      = RECLIST
         EXCEPTIONS
              TOO_MANY_RECEIVERS         = 1
                   DOCUMENT_NOT_SENT          = 2
                  OPERATION_NO_AUTHORIZATION = 4
                   OTHERS                     = 99.
        CASE SY-SUBRC.
          WHEN 0.
            LOOP AT RECLIST.
              IF RECLIST-RECEIVER = SPACE.
                NAME = RECLIST-REC_ID.
              ELSE.
                NAME = RECLIST-RECEIVER.
              ENDIF.
              IF RECLIST-RETRN_CODE = 0.
                WRITE: / NAME, ': succesfully sent'.
              ELSE.
                WRITE: / NAME, ': error occured'.
              ENDIF.
            ENDLOOP.
          WHEN 1.
            WRITE: / 'Too many receivers specified !'.
          WHEN 2.
            WRITE: / 'No receiver got the document !'.
          WHEN 4.
            WRITE: / 'Missing send authority !'.
          WHEN OTHERS.
            WRITE: / 'Unexpected error occurred !'.
        ENDCASE.
    <b>Please provide points if the issue is solved.</b>
    Regards,
    Sunil

  • RE: (forte-users) send/receive mail

    Hi Nat,
    you have three possibilities to integrate MAPI to a Forte program:
    1. using mapi32.dll (simple MAPI) or mapix32.dll (MAPI). You must integrate
    this libraries using a C wrapper class (as described in "Integrating with
    External Systems").
    2. using OLE Active messaging library ( as described in 'Integrating with
    Windows and Macintosh")
    3. or implement POP3 using an ExternalConnection class.
    Regards,
    Zenon Adamek
    Forte Developer
    Purolator Courier Ltd.
    ZAdamekpurolator.com
    -----Original Message-----
    From: Nat Balasubramaniam [SMTP:NBalasubdcjs.state.ny.us]
    Sent: Wednesday, January 26, 2000 2:18 PM
    To: Forte-userssagesoln.com
    Subject: (forte-users) send/receive mail
    Our application needs to send/receive mails from a mail server in NT
    environment. Does forte provide SMTP and POP3 protocol support(libraries)
    so that we can use external connection class to connect to the server and
    send/
    receive mails or do we have to use third party controls. Any help would be
    appreciated.
    For the archives, go to: <a href="http://lists.xpedior.com/forte-users">http://lists.xpedior.com/forte-users</a> and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

    Hi,
    Unfortunatly, Forte does not provide SMTP and POP3 protocoles.
    But, you can use External connections to do it if you need.
    You can find a simple SMTP send mail sample code on
    http://perso.club-internet.fr/dnguyen/ . The receive should be as easy as the send.
    For MIME base 64 encoding and decoding, it should last one or two weeks of coding
    (if you need optimization).
    One advantage of coding this in Tool directly is the portability.
    In your case, on NT, you could also interface with MAPI using for instance the
    ActiveX interface.
    By that way, you will already have SMTP, POP3 and MIME.
    Hope this helps,
    Daniel Nguyen
    Freelance Forte Consultant
    http://perso.club-internet.fr/dnguyen/
    edwardsmjwillis.com a &eacute;crit:
    Hi,
    Our Forte development team are currently investigating how we can add internet
    mail capabilities to a Forte application. Our application needs to send/receive
    mails from a mail server in an NT environment. Does forte provide SMTP and POP3
    protocol support (libraries) so that we can use external connection class to
    connect to the server and send/ receive mails or do we have to use third party
    controls ?.
    Any help regarding code examples or third party solutions would be appreciated.
    Thanks in advance
    Mark J Edwards
    Senior Technical Specialist
    Willis
    Email: edwardsmjwillis.com
    The information in this email and in any attachments is confidential and may be
    privileged. If you are not the intended recipient, please destroy this message,
    delete any copies held on your systems and notify the sender immediately. You
    should not retain, copy or use this email for any purpose, nor disclose all or
    any part of its content to any other person.
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

  • How do I set up my 3G to send/receive mail from MS exchange?

    How do I set up my 3G to send/receive mail from MS exchange?

    Welcome to the Apple Community.
    If you can't get your mail to work on Snow Leopard after June 30, you might want to try one of these approaches
    1. Configuring Mail in Snow Leopard
    2. Delete your mail account from Mail preferences and set it up again using the Mail Server Information.
    Some users have apparently encountered issues using this information in pre-Lion set ups (I haven't), Roger Wilmut has kindly provided instructions for those who find themselves with this problem.
    Entering iCloud email settings manually in Snow Leopard or Leopard

  • When I send out mail from MS Outlook enterprise account in the office to my Mac at home they are received as "winmail.dat" files.  Even if I perform a "save as" to the correct file name the file format is still not recognized.  Why is this happening!?

    When I send out mail from MS Outlook enterprise account in the office to my Mac at home they are received as "winmail.dat" files.  Even if I perform a "save as" to the correct file name the file format is still not recognized.  Why is this happening!?

    http://www.joshjacob.com/mac-development/tnef.php

  • When I send e-mail messages with file by using a POP3 in Exchange 2010 I received delivered message with file. How I can disable this functions that file do not include to delivery message. I use Exchange 2010 only local users.

    When I send e-mail messages with file by using a POP3 in Exchange 2010 I received delivered message with file. How I can disable this functions that file do not include to delivery message.  I use Exchange 2010 only local users.

    I think there is not native rule for this, but you could try a transport rule which removes all attachments over a very small file size like 1KB.
    http://blogs.technet.com/b/exchange/archive/2009/05/11/3407435.aspx
    CRM Advisor

  • HT5225 unable to send receive mail using Mail 2.1.3

    Ever since iCloud took over, I am no longer able to send/receive mail using Mail 2.1.3 on my 10.4.11 version.  I didn't think it would affect it.  Someone please help as to how I can rectify the issue!

    Hi,
    Please review the following note:
    Note: 371830.1 - Notification Mailer Does Not Start, Remains In Status Starting
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=371830.1
    If the above does not help, I suggest you run "Workflow Diagnostics" test and see if it returns any error/warning messages.
    Note: 274764.1 - Oracle Workflow Cartridge Workflow Java Mailer Setup Test
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=274764.1
    Note: 378281.1 - How Does One Verify The Notification Mailer Is Functioning Properly?
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=378281.1
    Regards,
    Hussein

  • Send/receive mail

    Our application needs to send/receive mails from a mail server in NT
    environment. Does forte provide SMTP and POP3 protocol support(libraries)
    so that we can use external connection class to connect to the server and send/
    receive mails or do we have to use third party controls. Any help would be
    appreciated.

    I think with the .mac account that is a known bug, and just click ok, at least that is what I do. I would assume the same with your cable ISP. Let's hope that is solved with 10.5.2
    As for your accounts being offline I also get the same behavior, either when I reboot my internet connection but Mail is still opened or randomly for certain accounts. I have only found that either waiting for a while or quitting Mail and opening again will work. Again, let's hope whatever strange behavior here is fixed with 10.5.2
    I know I am not offering any solution here, just confirming that others are experiencing the same behavior.
    hope this helps

  • TS3408 I can no longer receive or send e-mail on Safari, or search using Bing.  When URL's are typed in and entered, there is no response.

    Safari is apparently frozen.  I can no longer receive or send e-mail on Safari, nor search using Bing.  When URL's are typed in and entered, there is no response.  Obviously, I can still use Firefox for these needs, but how do I get Safari back to work?

    I have the same issue - it worked once, then the error pop-ups keep coming asking for the same darn password I gave it and saved 100 times before. Anyone else find a solution? I use my earthlink for outgoing and that works but would rather use godaddy since I pay for it.

  • How to configured different AD sites mailbox user able to send & receive mail to each other?

    I have 2 system in one system i configured DC=Yahoo.com + Xchange07 & on 2nd sytem i configured DC=Google.com + Xchange 07 successfully configured (in VMware)
    I already made entry of Both DC's DNS entry of New Host record & NewMail Exchanger (MX)
    both DC ping each other with DC name i.e. yahoo.com DC ping to google.com & vice-versa.
    Same AD site mailbox user able to send & receive mail but google.com mailbox user can't send & receive mail from yahoo.com as vice-versa.

    Hi,
    I recommend you check if you can telnet the other CAS/HT server on port 25 from each side.
    If it connects, is there any error message or NDR when sending or receiving email from each other?
    If it fails, please check if port 25 is open. If you have a firewall enabled, please make sure that port 25 is open. Besides, please check whether the DNS records have been configured correctly.
    Best regards,
    Belinda
    Belinda Ma
    TechNet Community Support

  • Mail app quit making sounds when sending/receiving mail.

    Mail app quit making sounds when sending/receiving mail. It was fine yesterday and just went mute today. I have Mac OSX 10.7.2 and a MacBook Air. Is there any way to fix this easily?

    I have the same issue. I'm wondering if I'm sending out viruses.
    Is this a common issue?
    Has this been solved?

  • Is there anyway to send a mail from Microsoft Outlook to solution manager?

    Is there anyway to send a mail from Microsoft Outlook to solution manager.
    If anybody having notes or documents that will be very much helpful for me.
    Awaiting for your reply,
    With best Regards,
    Alexey

    Hi,
    It is just the inbound mail configuration as like the out bound config.
    Below are the required demo, blogs,helps
    [Demo on Mail from outlook|https://www.sdn.sap.com/irj/scn/elearn?rid=/library/uuid/5087262b-59ef-2910-abb1-957000b7c3d4&overridelayout=true]
    [blog 1 for mail to SAP|http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417800)ID1382272150DB00641126052855673650End?blog=/pub/wlg/795 ]
    [Artical inbound mail config|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/10dfad5a-5398-2b10-568b-d3d999d49b5c]
    Hope this helps
    Jansi

  • I am unable to send e-mails from my Outlook

    Everything was working ok, for ages. Suddenly I am unable o send e-mails from my Outlook.
    "The message I get is: 'Unable to send the message. Please verify the e-mail Address in your account properties'.
    When I 'Send a Test Message' from Outlook, Tools, Accounts. All actions are completed besides sending a test message when I also get the instruction.

    Hi
    If it happened suddenly so possibly it was a virus?
    I dont know why you are not able to send the e-mails.
    I think you should check the email account properties. Check the data of you POP3 and SMTP server.
    Im not a outlook expert but this options should be found somewhere in the email account properties.
    The last possibility would be deleting of the email account under outlook and then a new creation of the new account.

Maybe you are looking for

  • I am getting an error message when I try to burn a cd

    I am getting an eror message when I try to burn a cd of an iTunes playlist. The number that came up was 4310. Help!

  • "Save as pdf" button from InDesign

    Is it possible to make a "save as pdf" button from InDesign ? Best regards, Mette Louise

  • Order of execution of Queries in Workbook

    Hi, Am facing a problem wherein there is a mismatch between the order in which queries are embedded in the workbook and the order in which they are executed. For ex- query A is embedded in sheet1 and query B in sheet2. However, while executing the wo

  • Best Export Settings for SD in Premiere Pro CS6?

    I have some old SD footage in AVI format. My client wants the best quality that will play smoothly in his Windows PC. I tried Quicktime  NTSC DV and I tried H.263, NTSC DV but both have jagged edges on all fast motion (aliasing). Any suggestions?

  • Authorization code for SHO Anytime on Apple  TV

    When trying to authorize SHO Anytime on my Apple TV, the authorization code seems to be cut off the bottom of the screen.  I tried changing screen resolution, unplugging and restarting Apple TV, I even did a full restore.  The problem remains.  HBO G