Finding mail exchange addresses using java
hi freinds,
how to retrive the mx records by querying the DNS server.
thanx in advance
I have never used it, but here is a package of GPL classes for DNS resolution in 100% pure java.
http://sourceforge.net/projects/jdns/
Similar Messages
-
Where can I find Mails auto address files?
Where can I find Mails auto address files?
Open Mail.
In the Window menu, select Recent Recipients.
Edit as needed. You can remove an entry directly, using the in-window button. If you double-click an item, the Addrss Book will open to that card's page. -
Problem to access POP3 of MS Exchange Server using Java Mail
{color:#0000ff}Hi,
I have a requirement to read emails from my office mailbox using POP3 protocol which is in Microsoft Exchange Server.
My code is given below.{color}
{color:#0000ff}*package emailadaptor;*
import java.util.Properties;
import javax.mail.Session;
import javax.mail.Store;
*public class Test {*
*public static void main(String[] args) {*
* // POP3 server name of Exchange Server*
* String host = "popServer.domain.com";*{color}
{color:#0000ff}*
* // User name*
* String user = "domainName\\userName";*
* String password = "password";
* // Get a session. Use a blank Properties object.*
* Session session = Session.getDefaultInstance(new Properties());
* try{*
* // Get a Store object*
* Store store = session.getStore("pop3");*
* store.connect(host, user, password);*
* }catch(Exception e){*
* e.printStackTrace();*
*{color:#0000ff}I can ping popServer.domain.com from my machine where I am testing the code.*
For username I have tried with domainName\\userName and username pattern both but unsuccessful. For example if my username if user1 and my domain name is domain1 than the two patterns I have tried are ‘domain1\\user1’ and ‘user1’.
For both these cases I am getting same error, and below is my error stack Trace.
*{color}*
*{color:#ff0000}javax.mail.AuthenticationFailedException: The requested mailbox is not available on this server.*
at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:158)
at javax.mail.Service.connect(Service.java:291)
at javax.mail.Service.connect(Service.java:172)
at emailadaptor.Test.main(Test.java:19)
*{color}*
*{color:#0000ff}Please give me some idea and steps what is wrong with this code and if any other information is needed then also let me know that.*
Please help.
Regards,
*Gourab{color}
*{color}Turn on session debugging. What does the protocol trace show?
Are you able to connect with other mail clients, such as Thunderbird?
(Outlook doesn't count.) -
HI, Iam trying to Integrate Exchange server using Java Mail
Here is what iam stuck with, I have a problem while conneting to Exchange Server using imap over ssl.
My code looks like this
props.put("mail.imap.host",host);
props.put("mail.imap.sasl.authorizationid","user1");
props.put("mail.imap.sasl.enable","true");
props.setProperty("mail.imap.socketFactory.class","javax.net.ssl.SSLSocketFactory");
props.setProperty("mail.imap.socketFactory.fallback","true");
props.setProperty("mail.imap.socketFactory.port","993");
Authenticator auth = new myauthenticator(AdminUserName,AdminPassword);
Session session = Session.getInstance(props,auth);
session.setDubug(true);
Store store = session.getStore("imap");
store.connect();
I get the following Exception as
javax.mail.MessagingException: Software caused connection abort: recv failed;
nested exception is:
java.net.SocketException: Software caused connection abort: recv failed
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:571)
at javax.mail.Service.connect(Service.java:310)
at javax.mail.Service.connect(Service.java:169)
at javax.mail.Service.connect(Service.java:118)
at MoveCalendar.move(MoveCalendar.java:63)
at SendCalendar.send(SendCalendar.java:74)
at SendCalendar.main(SendCalendar.java:40)
Caused by: java.net.SocketException: Software caused connection abort: recv failed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at com.sun.net.ssl.internal.ssl.InputRecord.a(Unknown Source)
at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
at com.sun.mail.util.TraceInputStream.read(TraceInputStream.java:110)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at com.sun.mail.iap.ResponseInputStream.readResponse(ResponseInputStream.java:97)
at com.sun.mail.iap.Response.<init>(Response.java:96)
at com.sun.mail.imap.protocol.IMAPResponse.<init>(IMAPResponse.java:61)
at com.sun.mail.imap.protocol.IMAPResponse.readResponse(IMAPResponse.java:135)
at com.sun.mail.imap.protocol.IMAPProtocol.readResponse(IMAPProtocol.java:261)
at com.sun.mail.iap.Protocol.<init>(Protocol.java:114)
at com.sun.mail.imap.protocol.IMAPProtocol.<init>(IMAPProtocol.java:104)
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:538)
... 6 more
DEBUG: setDebug: JavaMail version 1.4.1
DEBUG: getProvider() returning javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc]
DEBUG: mail.imap.fetchsize: 16384
DEBUG: enable SASL
DEBUG: mail.imap.sasl.authorizationid: user1
If i change the sessionFactory.class or if I remove this property I donot get any Exception It gets Executed well, but IT goes directly to the Adminstrators Mail account but not to the AuthorizationId I gave it. Can any one give me sugssion upon this issue.I don't understand whether the problem was with the Exchange Server I was trying to connect or with my local Environmenthi,
Iam very thankful for your reply here's the requested debug steps
DEBUG: setDebug: JavaMail version 1.4.1
DEBUG: getProvider() returning javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc]
DEBUG: mail.imap.fetchsize: 16384
DEBUG: enable SASL
DEBUG: mail.imap.sasl.authorizationid: user1
DEBUG: protocolConnect returning false, host=india.lendingspace.com, user=PMaganti, password=<null>
* OK Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 (lsinmail.india.lendingspace.com) ready.
A0 CAPABILITY
* CAPABILITY IMAP4 IMAP4rev1 IDLE LOGIN-REFERRALS MAILBOX-REFERRALS NAMESPACE LITERAL+ UIDPLUS CHILDREN AUTH=NTLM
A0 OK CAPABILITY completed.
IMAP DEBUG: AUTH: NTLM
DEBUG: protocolConnect login, host=****, user=AdminUserName, password=<non-null>
IMAP SASL DEBUG: Mechanisms: NTLM
IMAP SASL DEBUG: No SASL support
A1 LOGIN AminUserName AdminPassword
A1 OK LOGIN completed.
A2 CAPABILITY
* CAPABILITY IMAP4 IMAP4rev1 IDLE LOGIN-REFERRALS MAILBOX-REFERRALS NAMESPACE LITERAL+ UIDPLUS CHILDREN AUTH=NTLM
A2 OK CAPABILITY completed.
IMAP DEBUG: AUTH: NTLM
DEBUG: connection available -- size: 1
A3 SELECT INBOX
* 1 EXISTS
* 1 RECENT
* FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)
* OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Permanent flags
* OK [UNSEEN 1] Is the first unseen message
* OK [UIDVALIDITY 261914] UIDVALIDITY value
A3 OK [READ-WRITE] SELECT completed.
No of Messages msgs 1
A4 FETCH 1 (ENVELOPE INTERNALDATE RFC822.SIZE)
* 1 FETCH (ENVELOPE ("5 Mar 2009 13:25:19 +0530" "Outlook Calendar Events Using Java" ((NIL NIL "XXXXX" "XXXXX")) ((NIL NIL "XXXXX" "XXXXX")) ((NIL NIL "XXXXX" "XXXXX")) ((NIL NIL "XXXX" "XXXX")) NIL NIL NIL "<XXXXX>") INTERNALDATE " 5-Mar-2009 13:25:19 +0530" RFC822.SIZE 1348)
A4 OK FETCH completed.
FROM: XXXX
SUBJECT: Outlook Calendar Events Using Java
DATE: Thu Mar 05 13:25:19 IST 2009
A5 FETCH 1 (BODYSTRUCTURE)
* 1 FETCH (BODYSTRUCTURE (("TEXT" "CALENDAR" ("CHARSET" "US-ASCII") NIL NIL "7BIT" 598 10 NIL NIL NIL) "mixed" ("boundary" "----=_Part_0_18680399.1236239719654") NIL NIL))
A5 OK FETCH completed.
[ Multipart Message ]
CONTENT:TEXT/CALENDAR; charset=US-ASCII
A6 STORE 1 +FLAGS (\Answered)
* 1 FETCH (FLAGS (\Answered \Recent))
A6 OK STORE completed.
A7 COPY 1 CALENDAR
A7 OK [COPYUID 262745 258 23] COPY completed, 1 messages copied.
A8 EXAMINE INBOX
* 1 EXISTS
* 0 RECENT
* FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)
* OK [PERMANENTFLAGS ()] Permanent flags
* OK [UNSEEN 1] Is the first unseen message
* OK [UIDVALIDITY 261914] UIDVALIDITY value
A8 OK [READ-ONLY] EXAMINE completed.
A9 CLOSE
A9 OK CLOSE completed.
DEBUG: added an Authenticated connection -- size: 1
A10 LOGOUT
* BYE Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 signing off.
A10 OK LOGOUT completed.
DEBUG: IMAPStore connection dead
DEBUG: IMAPStore cleanup, force false
DEBUG: IMAPStore cleanup done
Actually what iam doing is read a mail which was more recent in inbox and If it is an Calendar event Iam copying that mail to Calendar Folder. So that Microsoft OUTLOOK automatically recongnizes them and secudles them in it's Calendars
This is actually done for adminstrator's Account but not for the user1
As you have suggested I removed the socketFactory class stuff and did this.
and this is my modified Code
props.put("mail.imap.host",imapHost);
props.put("mail.imap.sasl.enable", "true");
props.put("mail.imap.sasl.authorizationid", "user1");
Authenticator auth=new myauthentication(imapUserName,imapPassword);
Session session = Session.getInstance(props,auth);
session.setDebug(true);
store = session.getStore("imap");
store.connect();
And that goes like that. -
How to find Free disk space using Java program ?
Hi friends,
I need to find out the Free Hard disk Space to alert the user and send them mail if hard drive is about 85% full.
i am developing databackup program in which i have to check it , if hard drive is fulled with 85% or remain left space is less email sent to user to notify and delete older backups.
give me solution using java program...
please
Help me i need it in recent...Hi friends,
I need to find out the Free Hard disk Space to alert
the user and send them mail if hard drive is about
85% full.
i am developing databackup program in which i have to
check it , if hard drive is fulled with 85% or remain
left space is less email sent to user to notify and
delete older backups.
give me solution using java program...
please
Help me i need it in recent... -
Isn't possible to get MAC address using java
I am trying to get the MAC address of my pc using java code. It seems that i am only able to get the ip address. Can anyone help?
Use JNI or Runtime.exec(). For the latter you would need to find an OS command line tool and then parse the output.
-
Finding drives of computer using java
Hello All,
I am writing "explorer" using java . I am unable to find API that will
let me find the drives of a pc. E.x :- c:\ d:\ etc...
A computer can have any number of drives .
Please tell me what I should do.
Any help will be appreciated. Thanks in advance
sameerTry the listRoots method in java.io.File .
-
How to get MAC address using java code
hi friends
please write me, How can I get MAC Address of local machine using java code.I don't want to use JNI.
Please reply me. Its urgent for me
Thanks in advance
USYou have several ways under *nix
ifconfig -a | grep HWwill output something like
eth0 Lien encap:Ethernet HWaddr 00:11:FF:74:FF:B4combined with Runtime.getRuntime().exec("")and Process.getInputStream()you should be able to read it easilly.
Under Windows (and Linux of course) try jpcap (http://sourceforge.net/projects/jpcap)
You can also use jnative as a generic tool (http://sourceforge.net/projects/jnative)
--Marc (http://jnative.sf.net) -
How to fetch the BCC address using java mail
Hi,
I want to extract the mail address given in the Bcc address field of an email which I fetch it from the IMAP store !!
I will be very much thankful if this problem is solved !!
Thanks!!You can read the Bcc addresses just like the To and Cc addresses. But.... Note that Bcc addresses
won't be present in any message you receive; if you could see the Bcc addresses it wouldn't be a
blind carbon copy. If you create a message with Bcc addresses and save that message in your
"Sent Items" folder, you'll be able to read the Bcc addresses in that message. -
Can't find class when i use java.awt.Panel
I got a Pocket PC with CE 3.0
I made my first PJava application just a few hours ago. And it works fine. But when i introduce a Panel to improve the interface then application fails on the Pocket PC with the error message "could not find class application". When i remove the Panel it works fine again.
I thought that java.awt.* is part of PJava. And even if not i should be able to introduce even a java.lang.* class to the PJava application if i use the JAR.
Any suggestion?you should provide more detail about your deployment procedures.
There are many ways to get this message. AWT in fact is part of pJava and works fine for most of us. So I assume the deployment is the problem. Have you checked the actual content of the JAR? Have you provided a path statement? How do you call your app (shortcut?) -
Find current host name using Java
I am running currently on Oracle 9i app server in a clustered environment. My application has business logic that needs current host name. How can I find out the host name without externalising(like properties file) the information. Is there a java api like
.getHostName()
Ramatry this:
import java.net.InetAddress;
public class Foo {
public static String getLocalhostName() {
String hostName = "";
try {
InetAddress address =
InetAddress.getLocalHost();
hostName = address.getHostName();
} catch (Exception e) {
// error handle any which way you like
e.printStackTrace (System.err);
return hostName;
}cheers,
Georg. -
How do i ping a specific ip address using java
I'm basically writing a client/server chat program that uses TCP/IP as the protocol of communication. When the client application starts running, it is suppose to ping the network and determine if the server is running on a specified ip address. I've written both the server and client application, but i'm facing the one problem of pinging the network using the client application.
I hope somebody comes up with a suggestion....http://www.rgagnon.com/javadetails/java-0093.html
-
How to find direction for address using google map
Hi all,
Please help me solve this .
i want to see the (way)direction from office to account address in google map below each each contact details.
i created a Account Web Applet, it is showing account address correctly
http://maps.google.com/?q=%%%Bill_To_ADDR_Address1%%%,+%%%Bill_To_CITY_City%%%,+%%%Bill_To_COUNTRY_Country%%%
But i want to see the direction from office, ..
Thanks in Advance.
[email protected]
Uthaya.Hello,
This is what you have to use as an example
http://maps.google.com/maps?f=d&source=s_d&saddr=Collins+Street,+Melbourne,+Victoria,+Australia&daddr=Elizabeth+Street,+Melbourne,+Victoria,+Australia
h5. This is the from address
Collins+Street,+Melbourne,+Victoria,+Australia
h5. This is the end location
Elizabeth+Street,+Melbourne,+Victoria,+Australia
What you will need to do is relace these values with %%%Bill_To_Addr_Address1%%% and so on -
Find direction for address using google map using web Applet.
Hi all,
Please help me solve this .
i want to see the (way)direction from office to account address in google map below each each contact details.
i created a Account Web Applet, it is showing account address correctly
http://maps.google.com/?q=%%%Bill_To_ADDR_Address1%%%,+%%%Bill_To_CITY_City%%%,+%%%Bill_To_COUNTRY_Country%%%
But i want to see the direction from office, ..
Thanks in Advance.
[email protected]
Uthaya.Hello,
This is what you have to use as an example
http://maps.google.com/maps?f=d&source=s_d&saddr=Collins+Street,+Melbourne,+Victoria,+Australia&daddr=Elizabeth+Street,+Melbourne,+Victoria,+Australia
h5. This is the from address
Collins+Street,+Melbourne,+Victoria,+Australia
h5. This is the end location
Elizabeth+Street,+Melbourne,+Victoria,+Australia
What you will need to do is relace these values with %%%Bill_To_Addr_Address1%%% and so on -
Is it possible to retrieve Address Book from MS Exchange using Java IMAP
My JSP is required to display all valid email address to end user.
Is there any way i can retrieve Name & Email information (Address Book) from M.S Exchange server using Java implementation of IMAP protocal?
I believe M.S Exchange server is IMAP compatible so i should'nt be required to do any configuration on mail server side ?
If somebody has recently done this please share the implementation details , thanks,.
Please also let me know how to attach duke dollars with this thread.No, because that Java implementation you refer to is completely oriented towards handling messages. The Exchange address book has nothing to do with that.
Maybe you are looking for
-
Warranty apple store, product bought elsewhere
Can I go to any apple store for any repair service although I have bought my iMac on amazon for instance? I wonder why there are plenty of offers online that are cheaper than apple itself... Is there any big advantage if I buy the product directly fr
-
How to start learning Weblogic Administration
Hi, I am working as an oracle DBA. I want to start learning Weblogic Administration and troubleshooting too. I am a newbie and for exposure I have installed Weblogic on my laptop. I want you to guide me how to proceed learning and getting expertise c
-
How do you redownload adobe photoshop with the creative cloud without having to "buy" it since I already am paying for the subscription?
-
SAP Query - Extract part of field
Hi, I created a query with a local field. I want to extract only the last 3 characters of a field. Is there a LEFT or RIGHT function I can use like in Excel? The field I want to extract it from is 12 characters long. Hope someone can help. Thanks, Lu
-
PS CS4 3D - Raytrace and Glossiness problem
When working with a 3D layer, I cannot use any textures besides the diffuse texture at the same time as using the render setting "Ray Traced". For example, everything works great when the render setting is set to "Solid": I can use a high quality gl