#!/bin/env python
#coding:utf-8
#Author roy
from exchangelib import DELEGATE,Account,Credentials,Message,Mailbox,Configuration
from sys import argv
import logging
import sys
reload(sys)
sys.setdefaultencoding('utf8')
logging.basicConfig(level=logging.WARNING,
filename='/tmp/new.log',
filemode='a',
format='%(asctime)s - %(pathname)s[line:%(lineno)d] - %(levelname)s: %(message)s')
def send_mail(to,subject,body):
try:
creds = Credentials(
username='roy',
password='')
conf = Configuration(
server='mail.163.com',
credentials=creds)
account = Account(
primary_smtp_address=&