Question:
Hi,
i have one more than 1 mail to send ,for each email i need to define new mailman object or i can reuse existing like below
mailman mm=new mailman(); int totalmails=3; for(int i=0;i<totalmails,;i++) { Email em=new Email(); mailman.sendmail(email); } or like below
int totalmails=3; for(int i=0;i<totalmails,;i++) { mailman mm=new mailman(); Email em=new Email(); mailman.sendmail(email); }
Thanks and Regards, Harish Chepuri.
It's far more efficient to use the same mailman object for multiple emails. This way the same connection to the SMTP server will be used for each email.