0

Email sending question

Hi, I want to send emails FROM deferent email addresses. Is there a way in Java when you send an email know how many email you've sent so far? Like when I send an email have like a counter showing how many emails I have sent? https://code.sololearn.com/c1dEFTZF578l/?ref=app

27th Nov 2019, 11:47 AM
Sibusiso Mbambo
2 Antworten
+ 3
You can probably declare a static variable for the class which has a method that ensures that a mail has been sent and there you can update the static variable to keep the count of mails sent. For eg- class sendMail{ static int mailCount; void mailSent(){ // do something mailCount++; } }
27th Nov 2019, 1:46 PM
Avinesh
Avinesh - avatar
+ 1
Thanks, I did just that!
1st Dec 2019, 12:43 AM
Sibusiso Mbambo