Exemplo n.º 1
0
def send_file_to_163():
    import mail_send
    for file_index in range(1, 11):
        filename = 'data/question_answer_content_2015_05_24.txt.partial_%s' % file_index
        print filename

        with codecs.open(filename) as f:
            mail_send.send_to_163_mail(f.read(), '*****@*****.**')
            time.sleep(10)
Exemplo n.º 2
0
def send_file_to_163():
    import mail_send
    for file_index in range(1, 11):
        filename = 'data/question_answer_content_2015_05_24.txt.partial_%s' % file_index
        print filename

        with codecs.open(filename) as f:
            mail_send.send_to_163_mail(f.read(), '*****@*****.**')
            time.sleep(10)
Exemplo n.º 3
0
 def mail_Q_A(mail_to):
     '''神回复发送到邮箱中'''
     qa_list = []
     with codecs.open('./data/humor_Q_A_old_version1.txt', encoding='utf-8') as f:
         for line in f.readlines():
             json_line = json.loads(line)
             Q = json_line['Q']
             A = json_line['A']
             Q_A_str = '<div><tr><td><font color="#4EABF9"><u>%s</u></font><br>%s</td></tr></div>\n' % (Q, A)
             qa_list.append(Q_A_str)
         mail_content = ''.join(qa_list)
         send_to_163_mail(mail_content, mail_to)
Exemplo n.º 4
0
 def mail_Q_A(mail_to):
     '''神回复发送到邮箱中'''
     qa_list = []
     with codecs.open('./data/humor_Q_A_old_version1.txt',
                      encoding='utf-8') as f:
         for line in f.readlines():
             json_line = json.loads(line)
             Q = json_line['Q']
             A = json_line['A']
             Q_A_str = '<div><tr><td><font color="#4EABF9"><u>%s</u></font><br>%s</td></tr></div>\n' % (
                 Q, A)
             qa_list.append(Q_A_str)
         mail_content = ''.join(qa_list)
         send_to_163_mail(mail_content, mail_to)