dcsimg
Keep getting empty header from pop account.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Andrew_Modelski
Posted On:   Tuesday, August 5, 2003 02:46 AM

I am making a program that needs to get the sender of each message on a pop server. I of course first tried Message.getFrom(). This returned NULL, so I tried MimeMessage.getSender() which also returned NULL. I next decided to try and print out all headers. Using the Message.getAllHeaders() function I supposedly got an Enumeration full of header objects. I then run through a loop printing the name and value of each header. To my surprise, nothing is printed. I know that I am connecting successfully to the pop server because I can print the size of messages. Any ideas? Am i doing something wrong or is my pop server just weird? Here is the code in question. Enumeration e   More>>

I am making a program that needs to get the sender of each message on a pop server. I of course first tried Message.getFrom(). This returned NULL, so I tried MimeMessage.getSender() which also returned NULL. I next decided to try and print out all headers. Using the Message.getAllHeaders() function I supposedly got an Enumeration full of header objects. I then run through a loop printing the name and value of each header. To my surprise, nothing is printed.



I know that I am connecting successfully to the pop server because I can print the size of messages.



Any ideas? Am i doing something wrong or is my pop server just weird?



Here is the code in question.



Enumeration enum = msg.getAllHeaders();

for (;enum.hasMoreElements();)

{

Header header = (Header)enum.nextElement();

System.out.println(header.getName() + " " + header.getValue());

}

   <<Less

Re: Keep getting empty header from pop account.

Posted By:   Claudio_Mietta  
Posted On:   Monday, October 13, 2003 09:27 AM

Andrew, I have the same problem, and I don´t have idea of what´s wrong.....If you know right now the solution...please send me an e-mail to claumietta@yahoo.com.ar whith the answer...thanks!!
About | Sitemap | Contact