Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

using smtp protocol to GET email

Posted on 2004-09-23
18
Medium Priority
?
250 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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 1000 total points
ID: 12143584
POP and SMTP
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12162017
8-)
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

722 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