def send(self):
<EOL>if self.status is OUTWARD_STATUS.get('<STR_LIT>'):<EOL><INDENT>return False<EOL><DEDENT>recipients = self.get_recipients()<EOL>emails = []<EOL>if OUTWARD_HTML:<EOL><INDENT>html_content = self.message<EOL>EmailClass = EmailMultiAlternatives<EOL><DEDENT>else:<EOL><INDENT>EmailClass = EmailMessage<EOL><DEDENT>message = strip_tags(self.message)<EOL>for recipient in recipients:<EOL><INDENT>msg = EmailClass(<EOL>self.subject,<EOL>message,<EOL>settings.DEFAULT_FROM_EMAIL,<EOL>[recipient],<EOL>)<EOL>if OUTWARD_HTML:<EOL><INDENT>msg.attach_alternative(html_content, "<STR_LIT>")<EOL><DEDENT>emails.append(msg)<EOL><DEDENT>try:<EOL><INDENT>counter = <NUM_LIT:0><EOL>for email in emails:<EOL><INDENT>if counter == OUTWARD_STEP:<EOL><INDENT>counter = <NUM_LIT:0><EOL>time.sleep(OUTWARD_DELAY)<EOL><DEDENT>email.send()<EOL>counter += <NUM_LIT:1><EOL><DEDENT><DEDENT>except socket.error as e:<EOL><INDENT>from logging import error<EOL>error('<STR_LIT>' % e)<EOL>self.status = OUTWARD_STATUS.get('<STR_LIT:error>')<EOL><DEDENT>self.status = OUTWARD_STATUS.get('<STR_LIT>')<EOL>self.save()<EOL>
Sends the email to the recipients