SidneyShaw / simple-java-mail

Automatically exported from code.google.com/p/simple-java-mail
0 stars 0 forks source link

Minor enhancement #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This is more a feature enhancement than a bug report.  The library seems 
excellent, but the one thing it doesn't support is the "reply to" option which 
JavaMail does.  Should just be a case of adding

1. a setReplyTo(String replyto) method to Email
2. a getReplyTo() method to Email
3. a check in Mailer to see whether a reply to is set and use it

This can be quite an important flag if using libraries in applications where 
you are sending on behalf of someone else.

Other than that, excellent work.

Original issue reported on code.google.com by email.to...@gmail.com on 19 Jul 2011 at 9:01

GoogleCodeExporter commented 9 years ago
Hello and thank you, but I'm not sure I understand, though!

I can see how getting a pre-configured reply email by using mimeMessage.reply() 
is useful, having set the to-address, from-address and subject with an added 
"RE: ", but is that what you meant? It seems you are suggesting getting and 
setting a String value 'replyTo', which I don't quite understand the need for; 
you could just use replyEmail.addRecipient(RecipientType.TO, fromAddress) with 
whatever value you like.

Please elaborate.

Original comment by b.bottema on 28 Jul 2011 at 5:53

GoogleCodeExporter commented 9 years ago
Sorry.  Obviously wasn't clear there.  SMTP and indeed javamail support a 
header "replyTo" which is used as the return path by SMTP servers over the 
original from address if present. 

This sounds a bit pointless, but is quite useful in the case of software 
applications which send email.  For example, we have an examination application 
which sends out notifications by email from "noreply@examsoftware.com".  
Sometimes, the email address put in by the exam centre are wrong, so the email 
bounces. 

By default, the email would bounce to the noreply@examsoftware.com address 
which isn't monitored, whereas we actually want bounces to go back to the user 
who entered the candidates details. To do this we set the replyTo header to the 
correct address.  

See http://code.google.com/appengine/docs/java/mail/usingjavamail.html where it 
says "You can set a "reply to" address using the setReplyTo() method.".  This 
is also supported in Commons Email so just have a look at the code and you'll 
see where it applies.

Hopefully that clears up the confusion.

Original comment by email.to...@gmail.com on 29 Jul 2011 at 9:30

GoogleCodeExporter commented 9 years ago
Ahh, I understand now. I think I actually use this feature with my gMail 
account, where I use my gmail account to send mail but reply-to I use my own 
domain address, which forwards to gmail (so that I'm not depending on gmail's 
availability).

I'll add this as soon as possible.

Original comment by b.bottema on 29 Jul 2011 at 9:42

GoogleCodeExporter commented 9 years ago
I've comitted the changes. I still need to test it before making a release.

Original comment by b.bottema on 29 Jul 2011 at 10:03

GoogleCodeExporter commented 9 years ago
No problem.  I don't actually "need" this but thought that the library was so 
nice and clean, it would be daft for it to be missing such a simple feature to 
implement!  Hopefully, might get to use this library in our next project

Original comment by email.to...@gmail.com on 29 Jul 2011 at 11:01

GoogleCodeExporter commented 9 years ago
Included in release 1.9

Original comment by b.bottema on 6 Aug 2011 at 1:05