raiseEmailError(g._('The system is not attempting to send an email from %s, to %s, with body %s.')%(fromaddr,toaddr,body))
exceptEmailError:
register_exception()
returnFalse
sent=False
whilenotsentandattempt_times>0:
try:
sent=body.send()
exceptException:
register_exception()
ifdebug_level>1:
try:
raiseEmailError(g._('Error in sending message. Waiting %s seconds. Exception is %s, while sending email from %s to %s with body %s.')%(attempt_sleeptime,sys.exc_info()[0],fromaddr,toaddr,body))
exceptEmailError:
register_exception()
ifnotsent:
attempt_times-=1
ifattempt_times>0:# sleep only if we shall retry again
sleep(attempt_sleeptime)
ifnotsent:
try:
raiseEmailError(g._('Error in sending email from %s to %s with body %s.')%(fromaddr,toaddr,body))