def send(self):
self._generate_email()<EOL>if self.verbose:<EOL><INDENT>print(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(timestamp())<EOL>)<EOL><DEDENT>recipients = []<EOL>for i in (self.to, self.cc, self.bcc):<EOL><INDENT>if i:<EOL><INDENT>if isinstance(i, MutableSequence):<EOL><INDENT>recipients += i<EOL><DEDENT>else:<EOL><INDENT>recipients.append(i)<EOL><DEDENT><DEDENT><DEDENT>session = self._get_session()<EOL>if self.verbose:<EOL><INDENT>print(timestamp(), "<STR_LIT>")<EOL><DEDENT>session.sendmail(self.from_, recipients, self.message.as_string())<EOL>session.quit()<EOL>if self.verbose:<EOL><INDENT>print(timestamp(), "<STR_LIT>")<EOL><DEDENT>if self.verbose:<EOL><INDENT>print(<EOL>timestamp(),<EOL>type(self).__name__ + "<STR_LIT>",<EOL>self.__str__(indentation="<STR_LIT>"),<EOL>)<EOL><DEDENT>print("<STR_LIT>")<EOL>
Send the message.
First, a message is constructed, then a session with the email
servers is created, finally the message is sent and the session
is stopped.