|
Hello,
I have changed the msgshow.java example provided in
JavaMail package into a servlet so I can run it with servletrunner
for windows to read emails from POP3 mailbox running on Linux (two machines enviroment one with Windows as client and other with Linux as server). The same code runs in original state as an application as well. But my problem is that it must work as servlet in
following enviroment -> (Apache + JServ running on Linux).
If I try to invoke the servlet (through MS-IE4) the
Apache server returns:
HTTP 404 - Error (Somthing like couldn't find the file). I can even send emails using a sample servlet and
JavaMail API but reading emails from a POP3 mailbox
seems to be much heavyer problem. Yes, I have mail.jar and activation.jar in my
classpath so I can compile the code.
<snip>
public void doGet (HttpServletRequest req,
HttpServletResponse res) throws ServletException,
IOException
{ out = res.getWriter(); int msgnum = 1; try
{
Properties props = System.getProperties(); Session session = Session.getDefaultInstance(props, null); Store store = null; store = session.getStore(protocol); if (host != null || user != null || password != null) store.connect(host, port, user, password); else store.connect(); Folder
folder =
store.getDefaultFolder();
if (folder == null) { out.println("No default folder"); out.close(); } ........... What am I doing wrong? Any suggestions would be much
appreciated.
H. Peivareh
|
- Re: POP3 + servlet problem trying to get emails Peivareh
- Re: POP3 + servlet problem trying to get emails Erik Hanson
- Re: POP3 + servlet problem trying to get emails Peivareh
- Re: POP3 + servlet problem trying to get emai... Craig R. McClanahan
- Re: POP3 + servlet problem trying to get ... Luc Saint-Elie
- Re: POP3 + servlet problem trying to get emails Erik Hanson
