Emmanuel said:
Sorry for posting this again, but let me reformulate my question :
Is there a way to compute the estimated time for sending an email with
some attachments?
I think I can have the speed connection and the size of the email, but
this way is too approximate...
[Sorry, I'd just finished replying to your other post before I saw this
one.]
If you have the size of the email and the speed of the connection, you can
get an approximate time, yes. If you need it to be a little more accurate,
you could probably recalculate the speed of the connection as you send.
I'm not sure if this is possible within Javamail (I imagine you just call
Transport.send() and let it do the work). However, for something like
sending a message it may be feasible to implement the sending of the
message yourself - SMTP isn't too complicated, and you could put the
relevent hooks in to update your current speed and ETA as you write the
data.
Ultimately though, you can't be much more precise about the time to send
until you've finished - there could always be an unexpected hold up caused
by an increase in network traffic or whatever.