how many emails are being sent?
Does the error occur sending the first email?
what if you create another email script that only sends one email?
really, it sounds like a server problem, not a code problem.
double check the SMTP Server address that you entered and make sure you have the right port.