so i have this code:
import smtplib from email.MIMEMultipart import MIMEMultipart from email.MIMEBase import MIMEBase from email.MIMEText import MIMEText from email.Utils import COMMASPACE, formatdate from email import Encoders import os def sendMail(to, subject, text, files=[],server="smtp.gmail.com:587"): assert type(to)==list assert type(files)==list fro = " psaoflamand@live.com >" msg = MIMEMultipart() msg['From'] = fro msg['To'] = COMMASPACE.join(to) msg['Date'] = formatdate(localtime=True) msg['Subject'] = subject msg.attach( MIMEText(text) ) a=0 username = ' psaoflamand@gmail.com ' password = 'pass'
in this code, it sends 21 files at a time to avoid exceeding the limit of gmail messages. But the problem is that the data in MIMEBase remains ... my question is, is there a way to delete all the data in MIMEBase? I'm sorry the indent is wrong
source share