Solved

using smtp protocol to GET email

Posted on 2004-09-23
18
244 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
table example 4 32
eclipse buid path vs tomcat lib path 10 34
ejb entity bean example issue 2 16
swing controls 2 16
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This video teaches viewers about errors in exception handling.

808 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