Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with java mail

 
Makarand Parab
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Thanks in advance

Regards
Makarand Parab
 
Rovas Kram
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Makarand Parab
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Thz in advance

Regards
Makarand Parab.
 
Chit Ming Chong
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also want to know besides looping through all the recipients' addresses one by one what else can we do.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic