Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting JavaMail Mailer to email one address at a time  RSS feed

 
Iain Emsley
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm working on a scheduling system and am trying to write a mailer which takes a collection of names (which vary), checks if it a group and is so expands the group into the individuals, then email each person individually with an .ics file. I've sort of got the mailer working and checking/expanding the groups but have not achieved the magic goal of emailing each person individually and would like some guidance to that end. Many thanks in advance.

[ November 28, 2008: Message edited by: Iain Emsley ]
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The code adds multiple recipients to a mail before sending it. If you want individual mails for each recipient, why don't you create a separate mail for each address? Or am I misunderstanding what you're asking?
 
Iain Emsley
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf, that's what I've been trying to do but attempts so far have left it broken. What I did try was to wrap the message bit inside the Iterator (at some point I may rewrite it as an external method but I just need to get to prototype at the moment) but it caused errors with the Transport not being found or the InternetAddress throwing various errors about the type.
<br />
Edited to add: So I took it back to a working state to seek advice.
[ November 28, 2008: Message edited by: Iain Emsley ]
 
Paul Clapham
Sheriff
Posts: 22487
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You had compile errors with some code... so you thought it would be a good idea to change the code to something which did compile, and then ask for advice about how to fix those (undescribed) compiler errors, while showing us the code which did compile?

Anyway. Take the code which sends a message and move it inside the loop, like Ulf said.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!