我已经安排了一种职能,即以邮递、文字图像和其他材料发送邮件,但现在我需要使用Cc(卡宾版)的功能,以便向不同的电子邮件发送复印件。
我对这项职能做了一些改动,但我不想这样做。
THe email is sent to the address (“toaddr”) and the letter show that there are other emails supplemented as Cc(tocc) emails, but the Cc emails do not recie the email.
更清楚一点(因为我认为我不清楚)就是一个例子:
Sender: [email protected]
Receiver: [email protected]
Copied: [email protected]
[email protected] receives the email and can see that [email protected] is copied on it.
[email protected] does not get the email.
if [email protected] reply to all the email, THEN cc@hotmail gets the email.
谁能帮助我告诉我,我需要改变职能? 页: 1
这是我的职责:
def enviarCorreo(fromaddr, toaddr, tocc, subject, text, file, imagenes):
msg = MIMEMultipart( mixed )
msg[ From ] = fromaddr
msg[ To ] = , .join(toaddr)
msg[ Cc ] = , .join(tocc) # <-- I added this
msg[ Subject ] = subject
msg.attach(MIMEText(text, HTML ))
#Attached Images--------------
if imagenes:
imagenes = imagenes.split( -- )
for i in range(len(imagenes)):
adjuntoImagen = MIMEBase( application , "octet-stream")
adjuntoImagen.set_payload(open(imagenes[i], "rb").read())
encode_base64(adjuntoImagen)
anexoImagen = os.path.basename(imagenes[i])
adjuntoImagen.add_header( Content-Disposition , attachment; filename= "%s" % anexoImagen)
adjuntoImagen.add_header( Content-ID , <imagen_%s> % (i+1))
msg.attach(adjuntoImagen)
#Files Attached ---------------
if file:
file = file.split( -- )
for i in range(len(file)):
adjunto = MIMEBase( application , "octet-stream")
adjunto.set_payload(open(file[i], "rb").read())
encode_base64(adjunto)
anexo = os.path.basename(file[i])
adjunto.add_header( Content-Disposition , attachment; filename= "%s" % anexo)
msg.attach(adjunto)
#Send ---------------------
server = smtplib.SMTP( localhost )
server.set_debuglevel(1)
server.sendmail(fromaddr,[toaddr,tocc], msg.as_string()) #<-- I modify this with the tocc
server.quit()
return