models.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:omni-forms 作者: omni-digital 项目源码 文件源码
def handle(self, form):
        """
        Handle method
        Sends an email to the specified recipients

        :param form: Valid form instance
        :type form: django.forms.Form
        """
        message = EmailMessage(
            self.subject,
            self._render_template(form.cleaned_data),
            settings.DEFAULT_FROM_EMAIL,
            self.recipients.split(',')
        )

        for file_object in self.get_files(form):
            message.attach(file_object.name, file_object.read(), file_object.content_type)

        message.send()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号