通知モジュールを含む web.py プロジェクトがあります。システムは HTML 形式の電子メールを送信してユーザーに通知します。
私はPythonでHTML形式の電子メールを送信する方法を知っています.(このQ sendmail with HTMLメッセージのdescでも)、またweb.py(バージョン0.37)のsendmail()関数も知っています。
import web
web.config.smtp_server = 'smtp.gmail.com'
web.config.smtp_port = 587
web.config.smtp_username = 'goooooooooooooogle@gmail.com'
web.config.smtp_password = '*********'
web.config.smtp_starttls = True
web.sendmail('goooooooooooooogle@gmail.com',['1361877@gmail.com'],'Hello nodexy','This email is from web.py !')
私が期待する :
web.sendmail('goooooooooooooogle@gmail.com',['1361877@gmail.com'],'Hello nodexy', '<html><img src="hello.png"/></html>')
web.py でこれを修正するにはどうすればよいですか? HTML 文字列を sendmail() 関数に設定できないのは確かです。