Solved

using smtp protocol to GET email

Posted on 2004-09-23
18
246 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
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
 
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
jboss wildfly 10.1 10 586
Why is enum singleton a better approach than static factory 3 64
jsp error 6 68
glassfish admin console 1 46
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Suggested Courses

737 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