python実現SMTP送信メール(三)-抄送人

2259 ワード

python実装SMTP送信メール(三)-CC主にmsg["cc"]="を追加[email protected]「それでいい
[Python] 
テキスト表示
?
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35 import smtplib    from email.mime.text import MIMEText    from email.header import Header
     #    smtpserver = "smtp.163.com"
     # /    user = "[email protected]"    password = "123456"
     #    sender = "[email protected]"
     #    receiver = [ "[email protected]" , "[email protected]" ]
     #    subject = "Python-email2"
     msg = MIMEText( '

!

'
, "html" , "utf-8" )    msg[ "Subject" ] = Header(subject, "utf-8" )
 
     # , ,    msg[ 'From' ] = "[email protected]"    msg[ 'To' ] = "[email protected]"