import win32com. Client as win32
The import XLRD
Outlook=win32. Dispatch (' outlook. Application ')
Mail=outlook. The CreateItem (0)
Receivers=['. * * * *]
Cc='[email protected]' + '. '+' [email protected] '
Mail. To=receivers [0]
Mail. Cc=cc
Mail. Subject='attachment for details, please check! '
Workbook=XLRD. Open_workbook (' C: \ \ Users \ \ Administrator \ \ Desktop \ \ \ \ statements online index evaluation \ \ data \ \ email on May 5.1 \ \ \ \ \ \ clinch a deal the subsidiary 5.4 XLSX ')
MySheet=workbook. Sheet_by_index (0)
Nrows=mySheet. Nrows
The content=[]
For I in range (nrows) :
Ss=mySheet. Row_values (I)
Content. append (ss)
Print (content)
Truecontent=STR (content)
Mail. Body="attachment for details, please find!"
E-mail. Attachments. The Add (' C: \ \ Users \ \ Administrator \ \ Desktop \ \ report \ \ inspection \ \ data \ \ email on May 5.1 \ \ \ \ \ \ detail 5.4. XLSX ')
Mail. The Send ()
CodePudding user response:
E-mail. Attachments. The AddAdd 1, continue to add good,
Don't understand, send a mail app, open the XLS came out to show?
CodePudding user response:
E-mail. Attachments. The Add (1 path "files")E-mail. Attachments. The Add (" file path "2)
That's fine, kiss effective measurement