Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java mail : getting response from smtp server

 
abhi gupta
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having a mail sending class which sends the mail using SMTP server. I am sending the mail using the java mail api to connect to smtp server and send it using the method:

msg.setSubject(subject);
msg.setContent(multipart);
transport.sendMessage(msg, msg.getAllRecipients());
transport.close();

Can you guide me if there is any way in which i can get the report (containing status) of all the mails sent in a period of time. i.e. for example: say in last 1 hour. If there is pointer to code available for it, then it would be great!!
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Such reports are not part of the SMTP specification. It's possible you might be able to get such a report from your server, but you wouldn't use JavaMail to do that. Or you could insert your own code to keep track of when you sent the messages. Again that's nothing to do with JavaMail, just some regular database code that you would write.

And what do you mean by "status"?
[ January 28, 2008: Message edited by: Paul Clapham ]
 
abhi gupta
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul,

Thanks! for your quick response.

By 'Status', I mean is there a way by which I can track whether my mails have been sent successfully or not in a specified period of time, say 1 hr.

I can recieve the response from server using "SMTPTransport.getLastServerResponse()", but this would be giving me the response per mail. My requirement is to get a consolidated report from server of all the mails being sent.

Thanks!!
Abhishek
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, I see. Then you would have to see what the server provides in the way of reports. Don't expect it to have a Java API though.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic