Hi All My application is a java batch application, which executes certain batch of work and sends a status mail once the batch of work is done. I am using java mail to send the email. My mail client is Lotus Notes. If i give the group name in the "To" block, the mail class does not throw any exception and runs fine but i do not recieve the status mail. If i give my mail id in the "To" block, it sends me a status mail.
In short, i am not able to send emails to a particular group through java mail. can anybody let me know what's the problem.
I making an educated guess here because I've used the JavaMail API and I don't think there's a concept of groups. When you send mail to a group using Lotus Notes, the group is converted to individual addresses by the Lotus Notes client before sending to the outgoing mail server. When you use JavaMail, there's no code to translate the group into individual addresses.
Joined: Dec 10, 2004
Hi Thanks for the reply, but i have a query. Is there any way to send mail to multiple user. If i try to put comma seperated mail id's it gives error saying [Invalid string]. Is there any way out or shd comma seperated mail id's should work. Id there is any good example live on net to send mails to multiple users using java mail, plz do let me know. I would highly appreciate it.
In short, i am not able to send emails to a particular group through java mail.
A "group" in Notes (if I remember right) is not an address as such, rather a type of document, yes? So a group does not represent a recognizable address as far as SMTP is concerned - there is some conversion going on on the server (as Rovas Kram points out).
You can't use a CVS list of addresses, because Java Mail's InternetAddress class will parse the CSV to make sure it is RFC822 complient. But look at the Transport class's send methods - you'll notice that two take an array of InternetAddresss. Presuming you know the addresses in the Lotus Group, you can send to all of them this way.
I have a vague memory that there is an IBM supplied transport implementation for Lotus which ships with Domino. You might like to search IBM's site for such a thing - if there is it might let you use groups directly.