add sender's name in the from field of the email in python

后端 未结 6 1567
忘掉有多难
忘掉有多难 2020-12-31 12:17

I am trying to send email with below code.

import smtplib
from email.mime.text import MIMEText

sender = \'sender@sender.com\'

def mail_me(cont, receiver):
         


        
6条回答
  •  佛祖请我去吃肉
    2020-12-31 12:37

    The name comes from the FROM header. Refer to this answer please Specify a sender when sending mail with Python (smtplib)

提交回复
热议问题