Hi,
Send() method is of void return type. so we can't get a value based on which we would acknowledge whether a mail has been successfully sent or not.
One way to do this is, include the mail sending part in try block..
If any exception raises.. display sending failed message. Not only one exception that may raise like
1. Mail ID doesn't exists
2. Network Failure / Error
3. If user sending large size files, it takes time.. during which a user may refresh or perform any other event.
Hence, its good to include it in a catch block itself.
If i am wrong, plz correct me.
Regards,
Awesome Coding !! :)
Kondapallisrinivas, if this helps please login to Mark As Answer. |
Reply | Alert Moderator