How can I use authentication type in sending/receiving a message

Dear all,
I am building a mail client program. I have a problem: I don't know use javamail to authenticate to mail server in while send/receive messages. I know some authentication types as PLAIN, LOGIN, CRAM-MD5, DIGIT-MD5, NTLM and GSSAPI. and I tried use "mail.imap.sasl.mechanisms" property, but it do not work. Any suggestion is helpful for me. Thanks!

Thank for quick your reply,
I checked with Imap protocol to receive message. The mail server supported authentication type: Plain and Login. Below is code:
      Properties props = System.getProperties();
      String socketFactoryClass = "javax.net.SocketFactory";
      String host = account.getIncomingHost();
      int port = Integer.valueOf(account.getIncomingPort());
      String fallback = "mail.imap.socketFactory.fallback";
      String imapSocketFactoryClass = "mail.imap.socketFactory.class";
      String emailAddress = account.getIncomingUser();
      props.put("mail.mime.base64.ignoreerrors", "true");
      if (account.isIncomingSsl()) {
        MailSSLSocketFactory socketFactory = this.getSSLSocketFactory(host);
        if (account.getSecureAuthsIncoming().equalsIgnoreCase("starttls"))
          props.put("mail.imap.starttls.enable", true);
        else
          props.put("mail.imap.ssl.enable", "true");
        props.put("mail.imap.ssl.socketFactory", socketFactory);
        props.put("mail.imap.sasl.mechanisms", account.getAuthMechsIncoming());
      props.put(fallback, "false");
      props.put(imapSocketFactoryClass, socketFactoryClass);
      Session session = Session.getInstance(props, null);
      String protocolName = "imap";
      if (Utils.isGmailAccount(emailAddress))
        protocolName = imaps;
      IMAPStore imapStore = (IMAPStore) session.getStore(protocolName);
      try {
        imapStore.connect(host, port, emailAddress, account.getIncomingPassword());
      } catch (Exception e) {.....}account.getAuthMechsIncoming() return authentication types, this instance is Login or Plain(as I tested). By the way, I have a problem how to check authentication types supported by server(as Evolution Mail on Ubuntu has)?. sorry for my English. Thank for your consider time.

Similar Messages

  • How can I access an iPhone when I receive a message saying iPhone disabled connect to iTunes?

    How can I access an iPhone when I receive a message saying iPhone disabled connect to iTunes?
    Tried connecting to itunes and hitting restore and get a error message 3194.
    Any help would be greatly appreciated.

    odds are entering password too many times

  • How can I use Mac Mail to send a delayed mail?

    I am trying to send a delayed email, meaning the email is not sent immediately
    when the send button is pressed but at a pre-determined time.
    I have looked through Google, tried different third party scripts available, including
    Mail Scripts 2.10.3 by Andreas Amann, but none is supported under Mac OS X Lion.
    I believe Mac Mail itself does not support this feature (to my disappointment),
    but I read about using iCal and Automator to do my intended purpose.
    However, I am not familiar with script-writing. If someone can provide me a
    step-by-step procedure OR give me another way to do my intended purpose,
    it will be highly appreciated.

    I opened Airport Utility today and it appears to have been simplified to the point where you can't do much with it these days.
    Yes, welcome to the Fisher Price toy box utility.. where nothing in the way of advanced usage is offered.
    Is there a way to accomplish what I want to do that is reasonably simple?
    You can put time controls onto the offending addresses.
    But if the hackers know anything at all they know how to access the MAC address of the computer and change it.. so the effectiveness of this is limited.
    Change the current setup and password.. You must use WPA2 Personal and I recommend you use a pure alphanumeric password, mix case and numbers of 20 characters or more for your situation.. do not give that password to anyone.. protect the admin password of the TC itself equally well but with a different password. And protect the physical access to the TC from anyone in your home.. because the fact is all security on the TC is an illusion if the TC has open access.
    See how to find passwords here.
    i forgot my password for my router, how can I change them.
    So anyone can discover your passwords without your knowledge and leave no trace on your system.
    If you make no progress.. I suggest replacement of the TC as the main router of your network.. you need something with controls.. and even better controls that allow you to block people.
    The favourite one now is older Netgear WNDR3800 . .you might need to buy from ebay although a few new ones are still around.. alternatively the WNDRMACv2 is simply the same hardware in a white box.. instead of black.
    Load gargoyle firmware onto it.. sorry if I even point to where you can find this info my post will be deleted.. I can say it.. just cannot help further.. so use google.. there are lots of posts and let me assure you this get combo.
    You can continue to use TC at what it does best.. a dumb wireless AP and location for TM backups.

  • HT201209 How can I use app which I have received as gift.

    I have gifted a friend a application.
    But he has still not received any message or link regarding it.
    How can he receive and use tht app.

    When you purchased it for him, did the vendor supply you with a redemption code? Maybe just send your friend the code.

  • When I send an email the Iphone 5 IOS 8.1.3 takes an account I dont want to use, How can I use a default account for all the message I send, includes pics?

    Although I select hotmail as my default account (it´s my personal) Iphone always takes my corporative account to send my emails when I attach a pic, video, or any attachments. I want the Iphone always use my personal account (hotmail) to send all the attachments.

    Settings->Mail, Contacts,Calendars->Mail->Default Account should be set to the one you want to use.
    You can also, when attaching Pics, Tap on the CC/Bcc From Line and then on From to choose an account to send the pictures from.

  • How can I use object type in Jdeveloper 11g?

    Dear friends
    I made some object types(Database layer) and each one refer to functions or procedures to generate table or view, for instance in one of my project I could make a View Object with this function and generate a table:
    Select * from table (genarate_emp(2019))
    In this sample I used a static value (2019) and I did it perfectly, but I want to make a table with dynamic value for instance I would like to set partial trigger of this view object and get dynamic value from the other view object.
    Please help me if you have any suggestions.
    Best regards,
    Babak Saraie

    Hi Babak
    It's a common requirement on posting to this forum that you describe which version of JDeveloper you're using and what technologies (obviously ADF BC in this case).
    For making the static value dynamic within your View Object, are you familiar with the View Object bind variables/bind parameters? This will allow you to define a named variable in your VO that you can set programmatically or even let the user set. Play around with those first and see if they solve one part of your problem, then come back to the forum for the second part.
    Regards,
    CM.

  • How can i change the e-mail which receive a message about forgotten security questions ?

    i want to change the security question but i cant remember the answers or the password for the e-mail that recieve the message about forgotten security question .

    You need to ask Apple to reset your security questions; ways of contacting them include phoning AppleCare and asking for the Account Security team, clicking here and picking a method for your country, and filling out and submitting this form.
    They wouldn't be security questions if they could be bypassed without Apple verifying your identity.
    (104167)

  • How can I use jbo:InputSelect for a char type filed?

    How can I use <jbo:InputSelect for a char type filed?
    I have two tables. One is room (primary key is room(type is char)), another table is responsibility (foreign ker is room(type is char)). Both tables have same length for room column.
    There is a problem:
    If I use (in the "DataEditComponent.jsp" file)
    <jbo:InputSelect multiple="false" datasource="dsEdit" displaydatasource="roomData" displaydataitem="ROOM" displayvaluedataitem="ROOM" ></jbo:InputSelect>
    to get the room input for responsibility from combobox(Datasource roomData is from room table). In the form the room field cannot bind the data in combobox, alway select the first item. And if I select one item and click the update button.There is an error message:
    Error Message: JBO-27010: Attribute set with value H409 for Room in Responsibility has invalid precision/scale
    I found If I changed the field type from char to varchar2 in database also change the entity objects, it works well. I wonder if there are any diffrence using <jbo:InputSelect tag in char and varchar2 type. How can I use <jbo:InputSelect for a char type filed as i don't want to change my datatype in database at this stage.
    I try this in JDeveloper 9.03, 9.034, 9.04. The result is the same.

    If I were in your shoes, here's how I would do it:
    <%-- Assuming you have dsRoom and dsResponsibility --%>
    <%-- Select is an HTML tag --%>
    <select name="ROOM" size="1">
    <% char roomID =""; // Init your character var
    // Open a rowsetIterator to get the records and add them to the LOV
    <jbo:RowsetIterate datasource="dsResponsibility" changecurrentrow="true" >
    <% roomID = (char)dsResponsibility.getRowSet().getCurrentRow().getAttribute("ROOM"); // Grab the char value
    // add the value to the LOV
    %>
    <option value="<%=roomID%>"><%=roomID%></option>
    </jbo:RowsetIterate>
    </select>
    If you are using this as part of an edit page you may want to utilize the "selected" option of the <option> tag. In one instance I am doing this on an edit page because the use may open an existing record. If I don't account for it, then it will change the DB to contain the first value from the list! You can do a simple check like:
    //Set the current record's char
    char curRecord = (char)rowEdit.getAttribute("ROOM");
    // inside the iterate:
    if (curRecord == roomID) {
    <option value="<%=roomID%>" selected><%=roomID%></option>
    } else {
    <option value="<%=roomID%>" ><%=roomID%></option>
    Hope that helps!

  • How can I use LabVIEW to send the equivalent of a CTRL D (in VT 100 format) out the serial port of my computer?

    I am trying to write a vi that interfaces with a piece of OEM equipment that is set up to talk with a VT 100 terminal. I can't seem to locate the ASCII equivalent string (if there is such a thing) of a CTRL D. Is there a vi that emulates VT 100 commands?

    If I recall, CTRL-D is EOF on most ASCII tables.
    You'd probably have to use an escape sequence
    or if you can use an unsigned 8-bit that might be
    easier.
    In article <[email protected]>, TLS
    wrote:
    > How can I use LabVIEW to send the equivalent of a CTRL D (in VT 100
    > format) out the serial port of my computer?
    >
    > I am trying to write a vi that interfaces with a piece of OEM
    > equipment that is set up to talk with a VT 100 terminal. I can't seem
    > to locate the ASCII equivalent string (if there is such a thing) of a
    > CTRL D. Is there a vi that emulates VT 100 commands?

  • How can i produce this type of line chart (yield curve) by using flex2 charting?

    help! I am a flex newcomer, how can i produce this type of
    line chart (yield curve) by using flex2 charting? Anybody can teach
    me how can i customize the width of each scales as below of line
    chart? anybody know this?
    Click
    Here To See

    I need to show the X and Y Co-ordinate in a message when I click on the graphic's point.
    thanks for the tips, I´ll try to understand the sample program.
    Noguti

  • How can i use Catalog in Method Type?

    Dear Experts,
    How can i use Catalog in Method Type?
    I want to use Multiple method type mean require selection option(help from catalog)and also need to entere the result against certain parameters. So how can i do this possible ?
    Except use of additional infrmation field
    Regards,
    Abhishek

    Hi,
    Can i provide selection option F4 help at Method while enteing the result?
    Because for 1 MIC as per buyer method testing different so it will come alternately.
    i.e i have 3 methods which comes altarnative for one MIC
    TST_ISO
    TST_AATC
    TST_ASTM
    So how it is possible???

  • How can I use srvctl command line for change "Failover type" and "F method"

    Hi all,
    I am using Oracle One Node (11.2.0.3), and I have a service:
    /u01/11.2.0/grid/bin/srvctl config service -d orcl
    Service name: orcldb
    Service is enabled
    Server pool: orcl
    Cardinality: 1
    Disconnect: false
    Service role: PRIMARY
    Management policy: AUTOMATIC
    DTP transaction: false
    AQ HA notifications: false
    Failover type: NONE
    Failover method: NONE
    TAF failover retries: 0
    TAF failover delay: 0
    Connection Load Balancing Goal: LONG
    Runtime Load Balancing Goal: NONE
    TAF policy specification: BASIC
    Edition:
    Preferred instances: orcl_1
    Available instances:
    I would like to change "Failover type" and "Failover method" to:
    Failover type: SELECT
    Failover method: BASIC
    How can I do that? Is there any graphical tool for it? Or, How can I use srvctl command line for change it?
    Thanks in advance.
    Leonardo.

    user10674190 wrote:
    Hi all,
    I am using Oracle One Node (11.2.0.3), and I have a service:
    /u01/11.2.0/grid/bin/srvctl config service -d orcl
    Service name: orcldb
    Service is enabled
    Server pool: orcl
    Cardinality: 1
    Disconnect: false
    Service role: PRIMARY
    Management policy: AUTOMATIC
    DTP transaction: false
    AQ HA notifications: false
    Failover type: NONE
    Failover method: NONE
    TAF failover retries: 0
    TAF failover delay: 0
    Connection Load Balancing Goal: LONG
    Runtime Load Balancing Goal: NONE
    TAF policy specification: BASIC
    Edition:
    Preferred instances: orcl_1
    Available instances:
    I would like to change "Failover type" and "Failover method" to:
    Failover type: SELECT
    Failover method: BASIC
    How can I do that? Is there any graphical tool for it? Or, How can I use srvctl command line for change it?
    Thanks in advance.
    Leonardo.srvctl modify service -d database_name -s orcldb -q TRUE -m BASIC -P BASIC -e SELECT -z 180 -w 5 -j LONG
    Also see
    11gR2(11.2) RAC TAF Configuration for Admin and Policy Managed Databases [ID 1312749.1]

  • How can I use ichat on my macbook pro to send messages to my iPod 5

    How can I use ichat on my Macbook Pro to send messages to my iPod 5 ?

    If ipod 5 means ipod touch or iphone 5, simply create a AIM account and download the AIM iphone app. iChat and iMessage aren't compatible.

  • How can I use the Internet on my Iphone?Apple says they send an e-mail, but to Whom? I didn't receive an e-mail

    How can I use the Internet on MY I phone?

    Don't understand.
    Tap the Safari icon.  You will be on the internet.
    The iphone is designed to always have access to the internet.
    What exactly is your issue?

  • How can I use regular expression to open files of certain types in java?

    Ok this is the problem I am facing:
    I have a command line input of something like "/usr/foo/bar/*.html"
    and there are multiple files in that folder that end with .html.
    How can I use the input to go through/open all the .html files in Java?
    Help would be greatly appreciated thanks!

    Or if you have to do it in java, check out the interfaces java.io.FileFilter and java.io.FileNameFilter
    http://home.tiscali.nl/~bmc88/java/sbook/0128.html
    class HTMLFilter implements FilenameFilter {
        public boolean accept(File dir, String name) {
            return (name.endsWith(".html"));
    }Cheers,
    evnafets

Maybe you are looking for

  • Windows Backup fails to complete and System shows 29 Restore Points all titled "System Image restore point" but none will work.

    Problems both seemed to appear about the same time and may be related. Had backups on an  external drive prior to the problem and appeared to be working. I have since cleaned the external drive in an attempt to start a new backup series but it contin

  • Tables used for material ledger

    What are the standard tables used for material ledger

  • How do I play embedded mp3 files?

    Hello, Is Adobe Reader for iPad capable of opening my embedded mp3 files? If not, then how can I  get the audio to play inside the document?  The original document was created in Publisher 2012...converted to pdf where I embedded the mp3. Thank you f

  • Business process effecting FAGLSKF table

    Can anybody let me know by which process table FAGLSKF is updated with business transaction RKS and Object type OR.using tcode FAGLSKF it is updated as business transaction type GLSK while using tcode KB31N updated but cost center is required.Please

  • Having Correlation Problem

    Hello, I am looking at blog /people/sravya.talanki2/blog/2005/08/24/do-you-like-to-understand-147correlation148-in-xi I have one problem , I am not able to achieve N:1 as given in Logical Flow: point 5-- Transforms n PO6 Idoc into a single file struc