How to close connection to mail server?

hi and good day all.
how do i close a connection to a mail server?
this is how i connected to one:
     try{
               props = System.getProperties();
          session = Session.getDefaultInstance(props, null);
          store = session.getStore("pop3");
          store.connect(host, user, password);
          System.out.println("Opening inbox "+ user + " at " + host + "...");
               folder = store.getDefaultFolder();
          if (folder == null) { //throw new Exception("No default folder");
          System.err.println("No Default Folder Available.");
          folder = folder.getFolder("INBOX");
          if (folder == null) throw new Exception("No POP3 INBOX");
          folder.open(Folder.READ_WRITE);     
please.help...
thanks.

you can continue with :
     try {
     objFolder.open(Folder.READ_WRITE);                    
     } catch (MessagingException me) {
          objFolder.open(Folder.READ_ONLY);
Messages[] msgs = objFolder.getMessages();
     FetchProfile objFP = new FetchProfile();
     objFP.add(FetchProfile.Item.ENVELOPE);
     objFP.add(FetchProfile.Item.FLAGS);
     objFP.add("X-Mailer");
     objFolder.fetch(msg, objFP);
// close down
objFolder.close()
store.close()

Similar Messages

  • Photoshop Elements 5.0 PC.  Moved.  How do I change outgoing mail server? Photoshop trying to connect to old server for emailing pictures.  Thanks

    Photoshop Elements 5.0 PC.  Moved.  How do I change outgoing mail server? Photoshop trying to connect to old server for emailing pictures.  Thanks

    You say you have the pse 5 disk?
    I guess you do't have a dvd drive on your new windows 8 computer?
    Do you have access to another computer with a dvd drive?
    Anyway if you can find another computer with a dvd drive you could copy the pse 5 install disc to removable device like a camera card or flash drive.
    You can also buy cheap usb dvd drives.

  • How to set up a mail server with a private DNS and relay over a public mail

    How to set up the mail server that we can send and pick up emails inside and outside?
    Our private network has the DNS name dnsname1.private.
    We have our privat DNS Server and he can forward requests to outside over our router.
    Our public emails are hosted by an internet provider. This dns name is dnsname2.com and dnsname2.org.
    How we have to set up our mail server that we can pick up our emails from our public dnsname2.com?
    And when we write an email how we have to set up it that the dnsname is dansname2.com and not dnsname1.private?

    If you want to move your mailservice to your own (internal) server, start by making sure you can recieve traffic on port TCP 25 (SMTP). Some ISPs blocks this port, especially on "non business" connections.
    Can you send mail from your LAN directly to where your mail is hosted using port 25 TCP or do you have to relay via your ISP?
    You have a static public IP?

  • How can I connect to SQL Server CE?

    Hi!
    How can I connect to SQL Server CE ?
    Any idea?
    I found jdbc driver for SQL Server 6.5,7.0,2000.
    But no driver for SQL CE.
    Thanks for any suggestion....

    I am also searching for same answer.
    I wanna choose Access as a db. but I can't find that so I have a no choice to select SQL2000CE though.
    I am stuck in driver problem. I can't find that.
    Should I use Oracle Lite or PointBase?
    I am under a lot of stress... like you've been...
    I wish you find and post that....

  • How do i connect to sql server 2012 from cmd .

    Hi ,
    I Installed sql server 2008 R2 and 2012 Express and sql server2014 . I can conect to sql server 2008 R2 using
    SQLCMD -L command .
    How do i connect to sql server 2012 express edition from cmd .
    Any Hep appreciated
    Thanks in advance,
    Shravan

    I HAVE ANOTHER INSTANCE NAMED TEST  WHEN I USE THE COMMAND IT GIVES ME THIS ERROR 
    HOW TO RECTIFY 
    C:\Users\HP>SQLCMD -S HP-HP/TEST
    Sqlcmd: Error: Microsoft SQL Server Native Client 11.0 : Named Pipes Provider: C
    ould not open a connection to SQL Server [67]. .
    Sqlcmd: Error: Microsoft SQL Server Native Client 11.0 : Login timeout expired.
    Sqlcmd: Error: Microsoft SQL Server Native Client 11.0 : A network-related or in
    stance-specific error has occurred while establishing a connection to SQL Server
    . Server is not found or not accessible. Check if instance name is correct and i
    f SQL Server is configured to allow remote connections. For more information see
     SQL Server Books Online..
    PLZ HELP 

  • How to secure connection in sql server 2008? my main problem is which certificate should i add in mmc

    i'm recently working on hardening of sql server 2008. now i face with a problem. my problem is  how to secure connection in sql server 2008?  my main problem is which certificate should i add in mmc? what are these certificates about?and guide
    me in choosing the appropriate certificate.
    and how should i know that the connection in sql server is secured?
    plz guide me from the beginning cause i'm rookie in this subject.
    thanks in advance.

    Hi sqlfan,
    Question 1: my problem is how to secure connection in sql server 2008?
    Microsoft SQL Server can use Secure Sockets Layer (SSL) to encrypt data that is transmitted across a network between an instance of SQL Server and a client application. For more information about Encrypting Connections to SQL Server, please refer to the following
    article:
    http://technet.microsoft.com/en-us/library/ms189067(v=sql.105).aspx
    Question 2: my main problem is which certificate should i add in mmc? what are these certificates about?and guide me in choosing the appropriate certificate.
    To install a certificate in the Windows certificate store of the server computer, you will need to purchase/provision a certificate from a certificate authority first. So please go to a certificate authority to choose the appropriate certificate.
    For SQL Server to load a SSL certificate, the certificate must meet the following conditions:
    The certificate must be in either the local computer certificate store or the current user certificate store.
    The current system time must be after the Valid from property of the certificate and before the Valid to property of the certificate.
    The certificate must be meant for server authentication. This requires the Enhanced Key Usage property of the certificate to specify Server Authentication (1.3.6.1.5.5.7.3.1).
    The certificate must be created by using the KeySpec option of AT_KEYEXCHANGE. Usually, the certificate's key usage property (KEY_USAGE) will also include key encipherment (CERT_KEY_ENCIPHERMENT_KEY_USAGE).
    The Subject property of the certificate must indicate that the common name (CN) is the same as the host name or fully qualified domain name (FQDN) of the server computer. If SQL Server is running on a failover cluster, the common name must match the host
    name or FQDN of the virtual server and the certificates must be provisioned on all nodes in the failover cluster.
    Question 3: how should i know that the connection in sql server is secured?
    If the certificate is configured to be used, and the value of the ForceEncryption option is set to Yes, all data transmitted across a network between SQL Server and the client application will be encrypted using the certificate. For more detail about this,
    please refer to Configuring SSL for SQL Server in the following article:
    http://technet.microsoft.com/en-us/library/ms189067(v=sql.105).aspx
    If you have any question, please feel free to let me know.
    Regards,
    Donghui Li

  • IOS 4 : removing the "can't connect to mail server" messages

    Ok, since the new Mail in iOS 4 have a "global inbox", everytime i open the app without being connected on the internet, it send me 5 "can't connect to mail server" message. So i have to click "OK" five times before being able to use the app. It does that even when WiFi is set to off.
    Am i the only one ? Is there a setting for that ? Do I have to wait for iOS 4.1 ? Does god really exist ?

    Your email provider has servers. There are no Thunderbird servers. Thunderbird is email client software that runs on your computer.
    Contact your email provider about server issues.

  • What do you do when you get a 'connection to mail server failed' message?

    What do you do when you get a "connection to mail server failed" message?

    if it used to work and you did not change anything then it's most likely the internet connection or the mail provider server which are having the  problem in which case you wait
    if not then they changed their settings and you needs to adjust to their new settings
    or your carrier changed their settings so they block the required ports

  • How can i connect to SQL Server 7.0 on Windons Using JDBC

    How can i connect to Microsoft SQL Server 7.0 on a windows enviroment ?
    in sql server 2000 some jar files are required that is
    What you need to do is actually add all three jar files to your class path individually. There are three jar files that come with this driver the msbase.jar, msutil.jar, and mssqlserver.jar. for sqlQ server 2000.
    now the problem is that i cant find these files on my system. firstly where these files will be located. secondly are they will be used to connect to SQL Server 7.0. thirdly if not what is the procedure.
    My next Problem is that I have Websphere Studio Application Developer. in which their is this facility of Database Webpages its like a wizard which makes automatically beans servlets and JSP but before that you need a Driver Name and and Class Name for to Connect to the Database.
    Can you tell what is the specific Driver Path for the Microsoft SQL Server 7.0 . secondly is this the class which is used to connect to SQL server 7.0 "com.microsoft.jdbc.sqlserver.SQLServerDriver" where can i find this one. for SQL server 7.0.
    please provide some guidance in this regard.

    You can search for the JDBC drivers at, http://industry.java.sun.com/products/jdbc/drivers
    All the three jars that you specified are part of MsSQL Server jdbc driver. You need them (in the classpath) to get connected to the database.
    "com.microsoft.jdbc.sqlserver.SQLServerDriver" is the class in mssqlserver.jar. This is the driver class which will be used to get connected to the database.
    You can search in this forum for writting jdbc code (for Sql Server). If you don't find these jars, give me your e-mail id.
    Sudha

  • How to set up my mail server

    I have a Mac Mini with Mac OS X Lion Server 10.7.2 at home.  I'm trying to move away from a Windows SBS 2003 with MS Mail Exchange 2003.  Because I learned this stuff by setting up the Windows Server, I am trying to follow a similar approach with the Mac Server. (I understand I may have to re-train may brain.)  I set up the Mac Mini with a local domain. My setup is primarily for family use, so I did not see a need for registering a public domain.  (I've had the Windows setup running since 2003 and all has been fine with that setup.)  We have several desktops, and laptops around the house, so I want for everyone to be able to log in to any desktop/laptop they find and still be able to read/send e-mails under their own mail account and keep the mail folder structure they have created.  I'm trying for Mac Mail Server to receive all e-mail for all users (mail is provided by our ISP - Verizon.net; some users have more than one e-mail address), for clients to pull mail from the Mac Mail Server (via Mac Mail, or MS Outlook), the clients would send mail ) via the configured SMTP locally, and all the mail forlders to synchronize back to the Mac Mail Server for when the user logs in from another machine.  Is that possible?  If so, how?  I recall that in Windows SBS 2003 I configured a POP Connector that receives all the mail for all the users and I designated a domain user to send the mail to.  MS Exchange would take care of sychronizing the mail folders between the client connection and the mail server.  I bought the Mac Mini, a Time Capsule and an iMac to start my transition, but I'm not sure I'll be able to duplicate what I had with MS Exchange.

    Sorry, I know it is more a microsoft problem, but it happened when I tried to set up my icloud mail on my pc.

  • Can't connect to mail server - DNS Server settings?

    Hello:
    Let me preface this question by saying that computer networking is not my strong suit.
    Last week I moved our web hosting from our ISP to Lunarpages; our domain is marshall-arts.net. I set up some POP email accounts on our new mail servers and was able to successfully send and receive email wirelessly using our G4 ibook. However, none of our networked desktop systems could connect to our new mail server, although they could connect to our ISP's mail server; they also have no problem connecting to the web. The mail server and user names were identical between the desktop systems and the ibook. But upon closer examination of the TCP/IP settings of the ibook I found that the ibook had 209.253.113.10 entered into the DNS Servers (optional) field. That field was blank in the desktop systems. Once I entered that address into the DNS Servers field on the desktop systems they had no problem connecting to our Lunarpages mail servers.
    Here's our setup, as best as I can describe it:
    We have an AirPort Extreme connected to our DSL router. It's connected via ethernet, configured manually with a static IP, router and DNS server addresses provided by our ISP. It's set to distribute IP addresses with the AirPort client computers sharing a single IP address using DHCP and NAT (10.0.1.1. addressing). It's connected via ethernet to a Linksys gigabit ethernet switch to which we have connected three desktop Macs running OS 10.3.x and 10.4.x.
    The TCP/IP of the three desktop systems and the ibook are configured Using DHCP.
    As I wrote above, only the ibook had an address entered into the DNS Servers field, 209.253.113.10. This doesn't correspond to anything our ISP provided (those addresses are entered in the AirPort Extreme.) I have no idea where it came from.
    So I have two questions:
    Would that address have been generated automatically while setting up the AirPort connection on the ibook?
    Why would that supposedly optional DNS Server address be required for me to connect to our new mail servers (but not our old ISP mail servers)?
    Thank you.
    Shawn Marshall
    Marshall Arts Motion Graphics
    Dual 2.5 Ghz G5   Mac OS X (10.4.7)  
    Dual 2.5 Ghz G5   Mac OS X (10.4.7)  

    Hello:
    Let me preface this question by saying that computer networking is not my strong suit.
    Last week I moved our web hosting from our ISP to Lunarpages; our domain is marshall-arts.net. I set up some POP email accounts on our new mail servers and was able to successfully send and receive email wirelessly using our G4 ibook. However, none of our networked desktop systems could connect to our new mail server, although they could connect to our ISP's mail server; they also have no problem connecting to the web. The mail server and user names were identical between the desktop systems and the ibook. But upon closer examination of the TCP/IP settings of the ibook I found that the ibook had 209.253.113.10 entered into the DNS Servers (optional) field. That field was blank in the desktop systems. Once I entered that address into the DNS Servers field on the desktop systems they had no problem connecting to our Lunarpages mail servers.
    Here's our setup, as best as I can describe it:
    We have an AirPort Extreme connected to our DSL router. It's connected via ethernet, configured manually with a static IP, router and DNS server addresses provided by our ISP. It's set to distribute IP addresses with the AirPort client computers sharing a single IP address using DHCP and NAT (10.0.1.1. addressing). It's connected via ethernet to a Linksys gigabit ethernet switch to which we have connected three desktop Macs running OS 10.3.x and 10.4.x.
    The TCP/IP of the three desktop systems and the ibook are configured Using DHCP.
    As I wrote above, only the ibook had an address entered into the DNS Servers field, 209.253.113.10. This doesn't correspond to anything our ISP provided (those addresses are entered in the AirPort Extreme.) I have no idea where it came from.
    So I have two questions:
    Would that address have been generated automatically while setting up the AirPort connection on the ibook?
    Why would that supposedly optional DNS Server address be required for me to connect to our new mail servers (but not our old ISP mail servers)?
    Thank you.
    Shawn Marshall
    Marshall Arts Motion Graphics
    Dual 2.5 Ghz G5   Mac OS X (10.4.7)  
    Dual 2.5 Ghz G5   Mac OS X (10.4.7)  

  • How do I connect iCloud mail to outlook 2007

    I have followed the directions on the website for setting up outlook 2007 to retrieve and send mail through my iCloud account.  I continually receive an error message that outlook cannot connect to the imap server.  How do I fix this?

    I have the same problem.  I have also tried various variations listed on other websites (e.g. using "p01-imap.mail.me.com" or "p02-...." instead of "imap.mail.me.com" as the incoming mail server).  None of the variations works either.  I always get the error messages:
    "Log onto incoming mail server (IMAP):  Your server unexpectedly terminated the connection...."
    and
    "Send test email message:  None of the authentication methods supported by this client are supported by your server."

  • How to findout whether the mail server supports STARTTLS or not?

    Hi,
    In my application I want to use explict SSL over SMTP, IMAP and POP3 by using the property "mail.<protocol>.starttls.enable"
    . I did see the documentation for mail.<protocol>.starttls.enable property as
    "If true, enables the use of the <code>STARTTLS</code> command (if
    supported by the server) to switch the connection to a TLS-protected
    connection before issuing any login commands".
    How do I findout whether the server supports STARTTLS or not?
    What will be the outcome if I use the property "mail.<protocol>.starttls.enable" though the server doe's not support STARTTLS? plain text connection will be there or will it throw any exception?
    Thanks in advance!
    PrasadKT

    The "mail.<protocol>.starttls.enable" property will use STARTTLS if the server
    supports it, and won't if it doesn't. Not using it might cause later commands to fail.
    Newer versions of JavaMail also have a "mail.<protocol>.starttls.required"
    property that will cause the connection to fail if the server doesn't support
    STARTTLS.

  • CF10 IIS7.5 Cannot connect to mail server

    I recently did an sbs migration from sbs 2003 to sbs 2011. On the 2011 box I installed ColdFusion 10, but I cannot get my mail server verified in the administrator. I am able to telnet newserver.domain.local 25 successfully, however I cannot use that same server name in the CF admin to connect to the mail server. I keep getting the error "Connection Verification Failed! " in the CF Admin when I try to verify the mail server. I noticed an error in mail.log that says: "javax.mail.MessagingException: Unknown SMTP host: oldserver.domain.local; nested exception is: java.net.UnknownHostException: oldserver.domain.local". The old server name is being used and I do not know why. I've been through all the sbs migration steps to clean up DNS so I'm not sure where ColdFusion is getting that old server name in the Unknown SMTP host error. I double checked DNS did a flushdns and restarted ColdFusion, but no luck so far.
    If anyone has any other ideas how to troubleshoot this I'd greatly appreciate the advice.

    I figured out the SMTP host issue. I had some code in some old cfmail tags that had the server "oldserver.domain.local" hard coded. I removed that server property from the cfmail tag so it would default to what was in the CF administrator.
    Now I'm getting this error in the mail log: javax.mail.SendFailedException: Invalid Addresses; nested exception is: com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 Unable to relay 
    I'm not sure how to safely enable relaying on Exchange 2010. I think it has something to do with the recipient connector. Any assistance would be fantastic.

  • 10.4.7 - can no longer connect to mail server (SSL)

    After installing 10.4.7 I can no longer connect to my mail server.
    My mail server uses SSL on port 993 - but when I look at the error message when mail tries to connect I get the following:
    "There may be a problem with the mail server or network. Check the settings for account <accountname> or try again.
    The server error encountered was: The connection to the server <servername> on port 0 timed out."
    Why is it trying to connect on port 0?

    Found the solution in MacFixIt - unchecking the SOCKS proxy fixes the problem.

Maybe you are looking for