What EXACT version of Avast?
What OS?
What email client?
What other security (related) software do you have?
Anything about this in Avast’s log file? If so what?
Are you trying to send or receive a big email (size of the attached file)?
You can increase both your avast! timeout: Internet Mail provider > Customize > Advanced (tab)
and your email account timeout (generally, right click the email account, choose properties and the Advanced tab of settings).
Avoiding a problem really isn’t the answer, treat the disease not just the symptom as it may not be the avast time-out but rather an email client time-out.
What were you doing on-line when the connection time-out happened?