How to send secure email using JavaMail

Hi, anyone out there know how to send secure email using Java Mail? Greately appreciated.

For starters, if you have not already done so, read about it in the JavaMail design specifications.
Search for Message Security in the said document.

Similar Messages

  • How to Send Html Email using JavaMail?

    I want to send email message body as html.
    as some news sites send.What will easiest way of doing that?

    oops!!!
    Sorry there is one more thing in it the ByteArrayDataSource class. I am posting the code in the class here. Compile it in a separate class.
    class ByteArrayDataSource implements DataSource
        private byte[] data;     // data
        private String type;     // content-type
        /* Create a DataSource from an input stream */
        public ByteArrayDataSource(InputStream is, String type)
            this.type = type;
            try
                ByteArrayOutputStream os = new ByteArrayOutputStream();
                  int ch;
                  while ((ch = is.read()) != -1)
                // XXX - must be made more efficient by
                 // doing buffered reads, rather than one byte reads
                 os.write(ch);
                  data = os.toByteArray();
            } catch (IOException ioex) { }
        /* Create a DataSource from a byte array */
        public ByteArrayDataSource(byte[] data, String type)
            this.data = data;
              this.type = type;
        /* Create a DataSource from a String */
        public ByteArrayDataSource(String data, String type)
              try
             // Assumption that the string contains only ASCII
             // characters!  Otherwise just pass a charset into this
             // constructor and use it in getBytes()
             this.data = data.getBytes("iso-8859-1");
              catch (UnsupportedEncodingException uex)
              this.type = type;
         * Return an InputStream for the data.
         * Note - a new stream must be returned each time.
        public InputStream getInputStream() throws IOException
              if (data == null)
                  throw new IOException("no data");
              return new ByteArrayInputStream(data);
        public OutputStream getOutputStream() throws IOException
              throw new IOException("cannot do this");
        public String getContentType()
            return type;
        public String getName()
            return "dummy";
    }hope this will help
    best wishes
    khuda hafiz

  • How to send CC email using SO_DOCUMENT_SEND_API1

    Hi,
       How to send CC email using SO_DOCUMENT_SEND_API1.  Any sample code is very much appreciated.
    Cheers

    Please check In this function there is a flag in RECEIVERS table for sending mail as COPY or BLIND COPY

  • How to send sms,Email using java

    how to send sms,Email using java

    Hi,
    There are many sms gateways that have their own api to send sms. You can use them for sms. (They will charge you for the sms!!!)
    Moderator edit: Link removed
    Thanks
    Edited by: PhHein on 20.10.2010 16:11

  • How to send an email using XML Publisher

    Can any body help me how to send an email using XML Publisher.
    Regards,
    Suresh

    Sorry ,
    when a http://blogs.oracle.com/xmlpublisher/newsItems/departments/documentDelivery
    this it show this not answer the question.
    Thanks
    Welcome to Oracle Blogs
    Welcome to the Oracle blogging community, where Oracle executives, employees, and non-employees exchange views about customer requirements and best practices.
    We're sorry, the weblog you requested cannot be accessed.
    - You may not have the necessary permission for access the weblog.
    - This weblog does not exist.
    You may wish to try again using one of the tools below.
    - Check the URL and contact your System Administrator for access.
    - Or click here to go back to Oracle Blogs homepage.
    Powered by
    Movable Type and Oracle
    The views expressed on this blog are my own and do not necessarily reflect the views of Oracle. Terms of Use

  • How to send Secured Mail using Java Mail?

    I want to send mails with "Send Secure" option using Java Mail. Now mails are being sent using Java Mail connecting to smtp host.
    Appreciating your help.
    Thanks.

    There are third party libraries to help with this. Bouncy Castle is very popular.
    See the [JavaMail Third Party Products|http://java.sun.com/products/javamail/Third_Party.html] page.

  • How to send an Email using SMTPSSLTranport of JavaMail

    Hi,
    Provide me any sample code to send the mail using SMTPSSLTransport of JavaMail.
    Thanks,Sujata.

    is it something like that you want :
    (you can fin a similar answer in many places, even in this forum...)
    // mail session;
                   Session mailSession;
                   // set properties for appropriate server
                   Properties props = new Properties();               
                   props.put("mail.smtp.host", strServer);               
                   props.put("mail.smtp.starttls.enable","true");
                   props.put("mail.smtp.auth", "true");                    
                   props.put("mail.smtp.socketFactory.port", "465");
                   props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
                   props.put("mail.smtp.socketFactory.fallback", "false");
                // uncomment for debug
                // props.put("mail.debug", "true");
                mailSession = Session.getInstance(props, new Authenticator() {
                     protected PasswordAuthentication getPasswordAuthentication() {
                          return new PasswordAuthentication(strLogin, strPassword);}});          
                // prepare message
                Message message= new MimeMessage(mailSession);           
                InternetAddress[] arrToAddress = {new InternetAddress(strTo)};
                message.setRecipients(Message.RecipientType.TO, arrToAddress);
                InternetAddress fromAddress = new InternetAddress(strFrom);
                message.setFrom( fromAddress );
                message.setSubject( strSubject);          
                message.setText( strMessage );    
                message.setSentDate((Calendar.getInstance()).getTime());
                message.setHeader(Constants.PROXYMAIL_ERROR_OK, "JavaMail");
                // Send our mail message                               
                Transport.send(message);    

  • Sending an Email using JavaMail from the Net Work of my company not workin

    Hi,
    If any body would reply to this issue as soon as possible..
    I have developed a simple java mail program which sends an email to gmail (smtp.gmail.com) and works fine at home , So when i sent the same
    from my office(at company) it did not work and exception was reported saying ...... could not connect to host .smtp.gmail.com... port .. .
    I think it's a network problem.
    So If any body has a suggestion ?
    If so can any body give a simple code for this issue.
    Regards,

    No, I don't mean the msgshow.java demo program. I mean the [JavaMail FAQ|http://java.sun.com/products/javamail/FAQ.html].
    In particular, the section about debugging connection problems and the section
    about connecting to Gmail.
    Find it yet?

  • How to send HTML email using alert framework? Kindly help!

    Hi Experts,
          I am using alert framework (alert category) to send email. In the email message I want to use HTML content along with some hyperlinks.
         How can I do this?
         kindly help!
    Thanks
    Gopal
    Message was edited by:
            gopalkrishna baliga

    Hi,
    To send hyper links, you can add the links in the FollowUp Activity.
    The content of the mail from the alert framework will be a text mail.
    One option would be to check in your SCOT settings if it would be possible to set the Content Type as TEXT/HTML . If yes, then maybe this should be possible.
    Regards
    Bhavesh

  • How to send php email using email from recordset?

    Hi
    I know the headers to use for php mail(), and I use it for
    the contact form for my viewers in order to contact the directory
    listing's email address ( of which I have hidden by using the words
    'Email Us' and use the id to carry through to the form).
    I have sucessfully used the $to = [email protected] but when I
    want to use the $row_?['email'] it will not send.
    Any suggestions? I use a recordset to retrieve the id of the
    listing to the contact form.
    I will want to follow the same procedure for my jobseekers to
    contact employers job adverts.
    Thanks
    Theresa

    Hi,
    There are many sms gateways that have their own api to send sms. You can use them for sms. (They will charge you for the sms!!!)
    Moderator edit: Link removed
    Thanks
    Edited by: PhHein on 20.10.2010 16:11

  • How to send out email in HTML format instead of Plain text?

    Can anyone help? Or any website with that information?
    I am trying to send out email using javamail. But i want it to be in HTML format so that i can set font size,coulor and so on.
    Thanks in advance if you have any clue or solution.

    look at this page:http://developer.java.sun.com/developer/onlineTraining/JavaMail/contents.html

  • Sending a Directory using JavaMail

    Hi. Can anyone tell me how to send a directory using JavaMail? Thanks.

    what you can do is create a file object and load all the files one by one and attach them as a multipart object to the same mail.
    anurag

  • How to send meeting invites using Exchange Email Account

    Does anybody know how to send meeting invitations using the 3.0 software update?
    My corporate email is set up with an Exchange ActiveSync account, but I can't figure out how to send meeting invites?
    Is it a function solely of the iPhone 3.0 OS, or is it dependent on the Exchange setup.
    Any insight would be appreciated.
    David

    That is what I was afraid of...the good thing is that is the only feature (besides battery life) that I miss from my Blackberry. Thanks.

  • How to Send an Email to Outlook using process type in RSPC?

    Hi,
    How to Send an Email to Outlook using process type in RSPC?
    We created lot of process variants, actually we want to send an mail to users if the DP Background job was succesfully finished.
    Actually i tried with create message its not happening...
    Plz let me know .. its urgent ...
    Regards,
    Satish

    Hello Satish,
    If you want to send a friendly message to your users, then you can do this by building an ABAP program that calls function module SO_NEW_DOCUMENT_SEND_API1 . You can then insert this ABAP program in your process chain (using the ABAP program process type) or as a second step in your background job. With this technique, you can send an email to SAP users, or to external users (e..g Outlook email addresses)
    Here's  a sample ABAP code:
      data: ls_docdata type SODOCCHGI1,
            lt_objcont type table of solisti1,
            lt_receivers type table of somlreci1,
            ls_objcont type solisti1,
            ls_receivers type somlreci1,
            ls_user type syuname.
    * Fill these variables with subject and msg lines that you need.
    data: MAIL_SUBJECT     TYPE STRING,
    MSG_LINE1     TYPE STRING,
    MSG_LINE2     TYPE STRING,
    MSG_LINE3     TYPE STRING,
    MSG_LINE4     TYPE STRING,
    MSG_LINE5     TYPE STRING.
      ls_docdata-obj_descr = mail_subject.
      ls_objcont-line = msg_line1.
      append ls_objcont to lt_objcont.
      ls_objcont-line = msg_line2.
      append ls_objcont to lt_objcont.
      ls_objcont-line = msg_line3.
      append ls_objcont to lt_objcont.
      ls_objcont-line = msg_line4.
      append ls_objcont to lt_objcont.
      ls_objcont-line = msg_line5.
      append ls_objcont to lt_objcont.
    * t_userlist contains the list of users to whom th email will be sent.
      loop at t_userlist into ls_user.
        ls_receivers-receiver = ls_user.
    "Change the type  here if email is for outlook users, See documentation
    " of function module in SE37
        ls_receivers-rec_type = 'B'.            
        ls_receivers-express = 'X'.
        append ls_receivers to lt_receivers.
      endloop.
      CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
        EXPORTING
          document_data                   = ls_docdata
        tables
         OBJECT_CONTENT                   = lt_objcont
         receivers                        = lt_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
    You can test out the function module first in SE37 (just put the name of the FM and click execute). Testing it in SE37 will help you get your parameters right.
    Hope this helps.

  • How to bypass proxy when trying to send a mail using javamail smtp

    Hi,
    I am trying to make a servlet send a mail using javamail smtp protocol on port 25 but i m not able to send getting an exception, i suspect proxy is blocking, so any idea anyone how bypass a proxy.

    And if it does turn out that there's a proxy server blocking access to your target SMTP server, the best way to deal with that is to discuss the issue with the person responsible for your network configuration.

Maybe you are looking for

  • Issue in sales document

    Hi According to company scenario, there are sales order in bulk of same customer.in these no of documents some items are repeating also. so after placing sales order production person updates sales order on opening back order which shows list of orde

  • Icons and folders mess (iOS6)

    no idea what it was, never saw it happen before, I was moving an icon (the "photos" one to be precise) on my home screen, mistakenly put it over another icon, creating a folder (nothing special so far)... things started to be funny when I attempted t

  • PSE 4 Layering Questions

    I am new to PSE and am having a hard time getting the layering right, I need some "laymans" terms and easy first steps to work with, any help is greatly appreciated. For example I wanted to change an image to B&W (no problem doing that) then colorize

  • OAuthTokenIssuer cert not installing

    I'm having problems installing the OAuthTokenIssuer certificate on my single Lync 2013 FE server. I was running Lync 2010 when I lost my Edge server. At the recommendation of someone on this forum I began building my 2013 Standard environment rather

  • Sync'ing Problem! =(

    I had my iTunes on my old computer, and my computer broke. I got my new computer, and i just downloaded the newest itunes. I just tried to sync my songs, and it only synced less then half of my songs! Help, thanks! Some Reasons i think is interfering