• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Java mail : getting response from smtp server

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!
 
Sheriff
Posts: 28326
96
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 28326
96
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Roses are red, violets are blue. Some poems rhyme and some don't. And some poems are a tiny ad.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic