Solved

using smtp protocol to GET email

Posted on 2004-09-23
18
241 Views
Last Modified: 2010-03-31
Hi,
I am writing a JSP where I need to GET (not SEND) emails. The proper way of doing this is to create a store object such as:  
Store mstore = msession.getStore("pop3");
Here it will take a protocol such as "pop3" or "imap" as its argument but not "smtp".  The problem is that I need to use the "smtp" protocol because this is what is being used within our facility to GET emails as well as to SEND them. This protocol is typically correct for SENDING but not for GETTING emails. Our network administrator has the IMAP and POP3 protocols turned off on the Microsoft Exchange server and he will not allow any changes here that may effect our emails. The problem is that the getStore function will not accept "smtp" as it is not a typical store protocol argument. This function will accept a full url as oppose to just the protocol. However, when trying to use a full url (URLName object) I still run into the same problem if "smtp" is the protocol.  I have also tried just about everything with the setting of the properties in my program. Still no success. How do I create a store object in my program so I can connect with an "smtp" protocol to GET emails?
                Thanks, Don
0
Comment
Question by:donfmurphy
  • 9
  • 8
18 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 12135732
>>this is what is being used within our facility to GET emails as well as to SEND them.

How?
0
 

Author Comment

by:donfmurphy
ID: 12135898
Hi CEHJ,
I am receiving emails from a Microsoft Exchange email server. Our administrator has it set to return emails to each user with the SMTP protocol.
                 Thanks, Don
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12136193
I can only imagine that what's going on here is that an smtp server is running on your machine, with one target address (yours) so that your mail is being got through a push technology instead of a pull (connecting to a POP server from your machine). The only thing i can think of is to replace that server with a Java one over which you can then have control
0
 
LVL 22

Expert Comment

by:NovaDenizen
ID: 12136264
SMTP is definitely not a protocol used to download mail.  In SMTP, the client attaches to a server and pushes mail to the  server; the server can't push mail back to the client and the client can't pull mail from the server.

Maybe the mail server's hostname is "smtp.yourdomain.com" and you confused that with use of the SMTP protocol.  
"smtp" is a fairly traditional name for a mail server.
0
 

Author Comment

by:donfmurphy
ID: 12136421
Hi,
My machine is part of a network of machines that gets its email from a main Microsoft Exchange Server. I use Outlook to get my mail locally. Nothing out of the ordinary I don't think. On my local machine I am writing a JSP to GET this email. When I was not able to connect with POP3 or IMAP, I checked with the Administrator and he said that both those protocols are turned off on the server and that email is being retrieved from this server with the SMTP protocol. Which explains why I cannot connect. So I don't know how else to explain the problem.
                                  Thanks, Don
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12136489
>>I use Outlook to get my mail locally.

Have a look at the configuration of this, particularly what protocols are being used and the server addresses
0
 

Author Comment

by:donfmurphy
ID: 12136541
Hi CEHJ,
I have verified the addresses. How do I check for the protocol in Outlook, do you know?
                              Thanks, Don
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12136560
Are any of the addresses the same as your machine?

>>How do I check for the protocol in Outlook

Not sure - i use Outlook Express
0
 

Author Comment

by:donfmurphy
ID: 12137543
Hi CEHJ,
No the addresses are different from my machine. I have been looking into how I can check the protocol Outlook uses but have not found it yet.
               Thanks, Don
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 86

Expert Comment

by:CEHJ
ID: 12137584
How many are there?
Are they different?
0
 

Author Comment

by:donfmurphy
ID: 12137605
Hi CEHJ,
There is only one address that is used to both send and receive e-mails here.
            Thanks, Don
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12137705
Can you do

telnet <that address> 110

with any result?
0
 

Author Comment

by:donfmurphy
ID: 12137742
Hi CEHJ,
I get a 'Connection Refused'.
            Thanks, Don
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12137887
Out of interest, does the following produce anything?

netstat | find "25"
0
 

Author Comment

by:donfmurphy
ID: 12142966
Hi CEHJ,
I get a 'No such file or directory'.
            Thanks, Don
0
 

Author Comment

by:donfmurphy
ID: 12143409
Hi CEHJ,
What protocol does your Outlook Express use?
            Thanks, Don
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 250 total points
ID: 12143584
POP and SMTP
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12162017
8-)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to implement Singleton Design Pattern in Java.
This video teaches viewers about errors in exception handling.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now