Gray sky, Blue sea.

programing, book, photo

gae - mail.send_mailでhtmlメールを送信する

google.appengine.api.mail.send_mailを呼び出す際に、キーワード引数'html'を追加する。

Google App Engine: how to send html using send_mail

#Your html body
    mail_html_body = 'Hello!'

    # read data from request
    mail_to = str(self.request.POST.get('to'))
    mail_from = str(self.request.POST.get('from'))
    mail_subject = str(self.request.POST.get('subject'))
    mail_body = str(self.request.POST.get('body'))

    mail.send_mail(mail_from, 
                   mail_to,
                   mail_subject, 
                   mail_body,
                   html = mail_html_body ) #your html body