How do I connect to an SMTP server that requires a username and password?

Hi,
I am currently working on a project for university which requires me to send and receive email. I was until this week able to send mail no problem, but now the SMTP server has been upgraded so that each time a mail is sent it requires the username and password.
Ideally the connection should be made using TLS/SSL, and not use the Authenticator method. I want to pass the username and password directly if possible.
I've been trying to use the following but have been getting handshake, and other exceptions:
SMTPSSLTransport smtpSSLtransport = new SMTPSSLTransport(session,
                    new URLName("smtp", smtpHost, port, null-File,
                    "USERNAME", "PASSWORD"));
        smtpSSLtransport.setStartTLS(true);
        smtpSSLtransport.connect(new Socket(smtpHost, port));
        smtpSSLtransport.sendMessage(smtpMessage,                                                     message.getAllRecipients());
        smtpSSLtransport.close();Can anyone correct this piece of code for me or point me in the right direction of what classes and methods I should be using?
Many thanks in advance,
Gordon

I always wonder what misleads people to do things this way.
Was there some example you saw that suggested that instantiating
an SMTPSSLTransport was the correct approach? I hope not.
See the smtpsend.java demo program for how to use SMTP
authentication. If you need to use SSL, see the SSLNOTES.txt
file for hints on using the "smtps" protocol. smtpsend.java also
illustrates use of SSL, but you'll need to fix a bug in it to use the
correct property names ("mail.smtps.auth", etc.).

Similar Messages

  • How can we disable " XDB Requires a username and password"?

    Hello,
    I've just performed an Apex 4 installation on top of a DB 11.2.0.2.
    All is fine.
    No problem fine with FF, IE and Safari, but with Chrome I always have a pop up saying " The server XXXX: port at XDB requires a username and password".
    How can I disable that, or fix it definitively?
    Thanks
    Fred

    Sure.
    On my system Anonymous and XDB account were already unlocked and both used the same password.
    I simply executed the PL/SQL block that you can find here: http://www.apexexplorer.com/wp-content/uploads/2010/11/XDB-Password-Issue.pdf
    I bounced the listener.
    Hope that help
    Regards,
    Fred

  • The server at Mac OS X Server Web Services requires a username and password

    I am running SL Server 10.6.2, wiki works but when a person clicks an attached file in a wiki and then selects "open" they get a login popup with the notification The server at Mac OS X Server Web Services requires a username and password. It doesn't matter what they put into the login/pass it comes back. If they hit cancel then the document opens. If they click save then it saves with no issue. I can type in the admin login/pass of the server and it works. Does this mean the security settings to the location of the files is wrong? Any help is greatly appreciated!

    By the way they are using Internet Explorer 7 when opening these documents.

  • Have installed MacOsX Lion has trouble hooking up to my StoraNas server with my usual username and password, some who can help me?

    Have installed MacOsX Lion has trouble hooking up to my StoraNas server with my usual username and password, some who can help me?

    This is a common problam discussed on the Netgear forums.  I have yet to see a solution, just comments that there will need to be a fix from Netgear.  if anyone has heard of a solution or of the update being issued, please let us know.

  • E-mail server don't recognize username and password

    e-mail server don't recognize username and password combination (due to the iPhoto program, del e-mail posrcard)

    What e-mail client?
    For iPhoto e-mail-  iPHoto preferences ==> accounts
    for Apple Mail - Mail preferences ==> accounts
    for others see their instructions
    LN

  • HT1277 what to do when i get the message: email server did not recognize username and password combination.

    I changed the password on my iphone yesterda and now i can't send mail on my Imac via My gallery : the message is: email server did not recognize username and password combination

    I found that by turning of the SSL option at the bottom of the Accounts panel did the trick.

  • Unable to connect to the Linux server - getting a message - username and pa

    Hello,
    I am unable to connect to the Linux server - getting a message - incorrect username or password . I have used this number of times and I am sure I am using the correct username and password.However, I tried to log in this time after few months to the Enterprise linux server and got this message. I have the VMware version 2.5.0 build-122581. I am using the Enterprise Linux 2.6.9-89.0.0.0.1.Esmp OS to use the Oracle EBS R12 off it. When I click the console in the VMware it starts the Linux. While it is at the 'Network starting, stage it shows 'Determining IP information : Failed' and few lines down the line 'starting smartd': Failed as well, while others are ok. I suspect these are cause of the message 'Incorrect username or password'.
    What may be the issue? How do I resolve it?
    Any urgent help would be highly appreciated.
    Arunasish Sircar

    Hello Hussein,
    I cannot copy paste as I already mentioned. However I am just typing it from the text that I see - bottom few lines.
    Root Services Enabled
    Root Service Oracle Process Manager for PROD_linux adopmnctl.sh started
    Web Entry Point Services Enabled
    Web Entry Point Services Oracle HTTP_Server PROD_linux adalnctl.sh started
    Web Entry Point Services Oracle HTTP_Server PROD_linux adalnctl.sh started
    Web Entry Point Services Oracle OracleTNSListenerAPPS PROD_linux adapcctl.sh failed
    Web application Services Enabled
    Web application Services OACORE OC4J Instance PROD_linux adoacorectl.sh failed
    Web application Services FORMS OC4J Instance PROD_linux adfomsctl.sh failed
    Web application Services OAFM OC4J Instance PROD_linux adoafmctl.sh failed
    Batch Processing Services Enabled
    Batch Processing Services OracleConcMgrPROD_linux
    adcmctl.sh started
    Batch Processing services Oracle fulfillment server PROD_linux jtffmctl.sh started
    Other Services Disabled
    Other Services OracleFormsServer-Forms PROD_linux
    adformsrvctl.sh disabled
    Other Services Oracle Metrics Client PROD_linux
    adfmcctl.sh disabled
    Other Services Oracle Metrics Sever PROD_linux
    adfmsctl.sh disabled
    Other Services Oracle MWA Service PROD_linux
    mwctlwrpr.sh disabled
    Service Control is exiting with status 4
    I hope you can let me know how to resolve it.
    Thanks,
    AS

  • I am not able to send mails through Yahoo APP.It gives me an error msg :"the sender address has ben rejected by the server ".I tried adding username and password in the SMTP server settings,But those optiopns are greyed out.

    I am not able to send mails through Yahoo APP. It gives me an error msg :"the sender address has ben rejected by the server ".
    I tried adding username and password in the SMTP server settings,But those optiopns are greyed out.
    So, i am not able to enter anything in fields under SMTP server settings

    You probably have changing settings disabled in Restrictions.

  • Unable to connect to 11.5.10 vision instance Invalid username and password

    where using applications11.5.10.2 vision instance. We were able to connect to the database using sqlplus which means there must be nothing wrong with our connectivity. I've tried to logon to the applciations using the defauilt password w/c is operations/welcome.When I try to logon using ADI its giving me an error " Could not connect to the database Invalid Username and Password"
    GWYUID: applsyspub/pub
    FNDNAME:apps
    I'm also using the latest version of ADI w/c is 7.2.4.10.27.
    need help please on how to connect ADI to the Application
    THanks,
    Chase

    Check with your sysadmin. They may have setup a Server ID, which you will need to introduce to your database definition to complete the signon process.

  • I keep getting the message " The server 192.168.1.1:80 requires a username and password. The server says: RE1000"?

    Why am I getting this message and how can I fix it? I can't access any websites. What username and password an I supposed to put? I'm dumb with this stuff so please provide a simple explanation? Thanks.

    Do you mean the password of the wifi network i'm connected to?

  • Connecting printer to a secure wireless network which requires both username and password

    I have the hp photosmart 6510. I have it in my college dorm, which has a secure network with requires both a user name and password. I need help setting it up as I can't seem to get the printer to enter a username and password. I know the printer works and I know that my computer can print wirelessly with the printer. My college game me this setup configuration.
    Configuration Item Preferred Value Optional Value (less preferred)
    Network Name of SSID umd-secure  
    802.1x Operating Mode
    (note: 802.11b is no longer supported) Infrastructure or Network (not ad hoc)  
    Security Mode Enterprise (not Personal)  
    Network Authentication WPA2 WPA-less prefered
     Data Encryption CCMP or AES (TKIP-less prefered)
    Roaming Identity or Outer Identity anonymous  
    Authentication Type or Outer Authentication TTLS (PEAP-Less prefered)
    Authentication Protocol or Inner Authentication PAP (MS-CHAPv2-less prefered)
    Validate Server Certificate or Verify Server Name Yes  
    Certificate Issuer or Trusted Root CA Thawte Premium Server CA  (Any Trusted CA -less prefered)
    Server Name or Certificate Name wireless.umd.edu  
    Server Name must match Yes  

    Hi @hatyai ,
    Thank you for visiting our English HP Support Forum. We are only able to reply to posts written in English. To insure a quick response it would be advisable to post your question in English. The following links are here to assist you if you prefer to post in the following Language Forum.
    English: http://h30434.www3.hp.com
    Spanish: http://h30467.www3.hp.com
    French: http://h30478.www3.hp.com
    Portuguese: http://h30487.www3.hp.com
    German: http://h30492.www3.hp.com
    Korean: http://h30491.www3.hp.com/t5/community/communitypage
    Simplified Chinese: http://h30471.www3.hp.com/t5/community/communitypage
    Thank you for your understanding
    I work for HP. However I speak only for myself, not for HP nor anyone else

  • E-mail server doesn't recognize username and password

    Il server e-mail non ha riconosciuto la combinazione nome utente/password.

    What e-mail client?
    For iPhoto e-mail-  iPHoto preferences ==> accounts
    for Apple Mail - Mail preferences ==> accounts
    for others see their instructions
    LN

  • This server 192.2.2.1 at XDB requires a username and password

    Hi all,
    I am installing Apex 4.2 in Oracle 10.2.0.4 on SLES 11
    But I got the above error. :(
    I tried to google the error but to no avail. I see lots of similar error since 5 years ago and it seems there is no solution yet. sad sad sad.
    Is Apex 4.2 not supported in 10gR2?
    Please help.....
    Thanks a lot,
    zxy
    Edited by: yxes2013 on 28.2.2013 1:20

    We also had issues with Apex 4.2 and XDB
    This from our WIKI:-
    When XDB is used for Apex, the ANONYMOUS user must be configured for file access.
    as sysdba run the following:
    If this block has not been run, then when accessing Apex, one is channged for XDB credentials ("server said: XDB")
    SET SERVEROUTPUT ON
    DECLARE
    l_configxml XMLTYPE;
    l_value VARCHAR2 (5) := 'true'; -- (true/false)
    BEGIN
    l_configxml := DBMS_XDB.cfg_get ();
    IF l_configxml.
    EXISTSNODE (
    '/xdbconfig/sysconfig/protocolconfig/httpconfig/allow-repository-anonymous-access') =
    0
    THEN
    -- Add missing element.
    SELECT INSERTCHILDXML (
    l_configxml,
    '/xdbconfig/sysconfig/protocolconfig/httpconfig',
    'allow-repository-anonymous-access',
    XMLType (
    '<allow-repository-anonymous-access xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd">'
    || l_value
    || '</allow-repository-anonymous-access>'),
    'xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"')
    INTO l_configxml
    FROM DUAL;
    DBMS_OUTPUT.put_line ('Element inserted.');
    ELSE
    -- Update existing element.
    SELECT UPDATEXML (
    DBMS_XDB.cfg_get (),
    '/xdbconfig/sysconfig/protocolconfig/httpconfig/allow-repository-anonymous-access/text()',
    l_value,
    'xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"')
    INTO l_configxml
    FROM DUAL;
    DBMS_OUTPUT.put_line ('Element updated.');
    END IF;
    DBMS_XDB.cfg_update (l_configxml);
    DBMS_XDB.cfg_refresh;
    END;
    /

  • How to configure JMS-Server to use username and password

    Hi
    Maybe this is a real stupid question, but please help me, I'm not very experienced using JMS:
    I'm using JMS (provided by OC4J / Application Server 10.1.3). I configured a ConnectionFactory (without username and password) and a Queue and there is also a application, which successfully opens the JMS-Connections.
    This works well as long as I do not provide a username und password in the ConnectionFactory (EnterpriseManager: OC4J/Admin/Services/JMS-provider...). If I do this, my application terminates with the following stacktrace:
    javax.jms.JMSSecurityException: JMSServer[aplora2:12602]: failed to authenticate "myuser/mypassword", no such user.
         at com.evermind.server.jms.JMSUtils.make(JMSUtils.java:1034)
         at com.evermind.server.jms.JMSUtils.toJMSSecurityException(JMSUtils.java:1090)
         at com.evermind.server.jms.JMSServer.getJMSServer(JMSServer.java:1237)
         at com.evermind.server.jms.JMSServer.getJMSServer(JMSServer.java:1213)
         at com.evermind.server.jms.InContainerProxy.getJMSServer(InContainerProxy.java:93)
         at com.evermind.server.jms.EvermindConnection.<init>(EvermindConnection.java:103)
         at com.evermind.server.jms.EvermindQueueConnection.<init>(EvermindQueueConnection.java:62)
         at com.evermind.server.jms.EvermindQueueConnectionFactory.unprivileged_createQueueConnection(EvermindQueueConnectionFactory.java:98)
         at com.evermind.server.jms.EvermindQueueConnectionFactory.access$000(EvermindQueueConnectionFactory.java:42)
         at com.evermind.server.jms.EvermindQueueConnectionFactory$1.execute(EvermindQueueConnectionFactory.java:78)
         at com.evermind.server.jms.InContainerProxy.doSecureOp(InContainerProxy.java:157)
         at com.evermind.server.jms.EvermindQueueConnectionFactory.createQueueConnection(EvermindQueueConnectionFactory.java:75)
         at com.evermind.server.jms.EvermindQueueConnectionFactory.createQueueConnection(EvermindQueueConnectionFactory.java:66)
         at sam.model.messages.MessageManager.<init>(MessageManager.java:74)
    where "myuser" and "mypassword" are the username and password I entered in the ConnectionFactory. (My Application certainly uses the same username and password)
    I expected, that by entering username and password here I would configure my Queue to be protected by them. But obviously there are some very basic things I didn't understand. Can anyone give me a hint, how I can protect the (OC4J-) JMS-Server or the Queue by username and password?
    Thanks for your help
    Frank Brandstetter

    Hey Frank -
    Assuming you've set up users in the "Security Manager" for your application, you can specify what JNDI resources they can "read" (and thus also connect to) via the orion-application.xml file. Look at the following snippet from the orion-application.xml file:
         <namespace-access>
    <read-access>
    <namespace-resource root="jms/firstQueue">
    <security-role-mapping impliesAll="false" name="jmsSecurity">
    <user name="scooter"/>
    </security-role-mapping>
    </namespace-resource>
    </read-access>
    <read-access>
    <namespace-resource root="delme">
    <security-role-mapping impliesAll="false" name="jmsSecurity">
    <group name="messagingUsers"/>
    </security-role-mapping>
    </namespace-resource>
    </read-access>
    </namespace-access>
    This would say that only the user "scooter" that you've set up would have access to the Queue whose JNDI name begins with jms/firstQueue. Anyone you've set up and added to a messagingUsers group would have access to any Queues whose JNDI name begins with "delme". (I'm honestly not sure what exactly this line does: <security-role-mapping impliesAll="false" name="jmsSecurity">)
    This is the only way I've found to limit access to a particular Queue.
    HTH.
    Scott

  • I cant getmy new IPAD to connect to the wifi at my apartment.  how do i get a prompt to enter a username and password?

    I just purchased a new IPAD (16GB + 4G cell)  I am trying to get it to connect to the wifi hotspot at the apartment where I live.  The wifi signal requires a username and password.  How do I get the IPAD to prompt for the username and password?  Any help is appreciated

    Settings>General>Reset>Reset Network Settings

Maybe you are looking for

  • Dynamic file attachment in distribution.xml

    Hi I'm trying to attach a PDF file to a report using a distribution.xml file. If I hard code the filename it works fine but I need to attach a different file to every report so want to use a variable. Unfortunately this gives the error: Terminated wi

  • Help my ipod is stuck in recovery mode

    My ipod touch 4th gen is stuck in recovery mode. I have restored several times and it just goes back to recovery mode. What do I do?

  • UTube, blacked out vidios, when using your cure still cannot download

    Original problem sorted by Shift, left click reload. (still not a very satisfactory solution. Why is this happening only with Firefox) When video is running unable to download using any video downloader. The following is the popup report: Error: MP4

  • Unable to communicat​e with serial device using hex

    Hi... I have two instruments, both manufactured by the same company (Inficon), both that provide the same basic function which is rate control of vapor deposition...  Both instruments use RS-232 serial communication (baud rate of 19,200, 8 data bits,

  • Sql/plsql que

    hi to all, sql> desc test Name Null? Type DEPTNO NUMBER(2) DNAME VARCHAR2(14) LOC VARCHAR2(13) sql>begin execute immediate 'alter table test add lid number'; insert into test values (12,'hyd','sys',45); end; these are statements i excute but i got an