You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Simple Java Mail Wishlist -- clearRecipients() #90
I recently became acquainted with SimpleJavaMail. I've been testing it for a few days, and so far, I like it very much. Thank you very much for making it, and sharing it with us!
On your website, you asked for suggestions for how it could be improved. I have a few "wishlist" items for it. I'll put them in separate tickets so you can evaluate and track them individually.
Please add a way to clear the recipient list so the email object can be reused without having to reset all of the other fields:
email.clearRecipients();
If this was implemented, we could create the email once, add some recipients, send it, clear the recipients, add more recipients, send it again, etc. That would be very useful for bulk mailings where you don't want a lot of recipients, lest it be considered spam.
Ok. That would work. Thank you! That didn't occur to me.
We send out weekly newsletters, sending the same message, but sending it out as a separate email to each "AddressData" record in the group. Each of these records can have up to two email addresses, and in those cases, it's sent to both as one email. And it works well for us. In the past, when we sent them BCC to over 100 recipients, it'd be treated as spam by some people's servers / email clients. Since we started sending them this way, that has not been a problem.
I was thinking it'd be nice to create the Email object once, clear the recipients each time, etc. But creating an EmailBuilder object, and reusing it would accomplish the same thing.
Thank you again for your time and attention to this matter!
And thanks again for sharing this great project. I appreciate it.
Activity
bbottema commentedon Aug 14, 2017
I'm on the fence on this one. If you add
clearRecipients()why not 'clearHTMLBody()' or 'clearSubject()',clearAttachments().Moreover, if you use the
EmailBuilder, you can configure it once without recipients, then use it multiple times to build the same email:dormitionskete commentedon Aug 14, 2017
Ok. That would work. Thank you! That didn't occur to me.
We send out weekly newsletters, sending the same message, but sending it out as a separate email to each "AddressData" record in the group. Each of these records can have up to two email addresses, and in those cases, it's sent to both as one email. And it works well for us. In the past, when we sent them BCC to over 100 recipients, it'd be treated as spam by some people's servers / email clients. Since we started sending them this way, that has not been a problem.
I was thinking it'd be nice to create the Email object once, clear the recipients each time, etc. But creating an EmailBuilder object, and reusing it would accomplish the same thing.
Thank you again for your time and attention to this matter!
And thanks again for sharing this great project. I appreciate it.
bbottema commentedon Aug 14, 2017
With your use case, I just realized that there's a bug with the
EmailBuilder: #94. Currently this is blocking reuse of a single builder.I'll get that fixed asap. Until then I will keep this issue open.
dormitionskete commentedon Aug 14, 2017
Thank you.