<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def email(self, repo, event, fields, dryrun=False):
 """Sends an email to the configured recipients for the specified event. :arg repo: the name of the repository to include in the email subject. :arg event: one of ["start", "success", "failure", "timeout", "error"]. :arg fields: a dictionary of field values to replace into the email template contents to specialize them. :arg dryrun: when true, the email object and contents are initialized, but the request is never sent to the SMTP server. """

        tcontents = self._get_template(event, "txt", fields)
        hcontents = self._get_template(event, "html", fields)
        if tcontents is not None and hcontents is not None:
            return Email(self.server, repo, self.settings[repo], tcontents, hcontents, dryrun)