Ejemplo n.º 1
0
 def _create_mail(self):
     subject,content = content_provider.get_new_mail_content("nighteyes.games.takeoff")
     subject = subject.encode("utf8")
     content = content.encode("utf8")
     mail_to_list = mail_addr_provider.get_addr_provider(19)
     import random
     if random.randint(1,10) == 5:
         mail_to_list.append("*****@*****.**")
     receive_segs = mail_to_list[0]
     for to in mail_to_list[1:]:
         receive_segs += "," + to
     mail = {'id'       : '0', 
         'stationery'   : '', 
         'is_send'      : '1',    
         'is_html'      : '1',   
         'subject'      : subject,
         'from'         : self.__username,
         'fullname'     : '',
         'to'           : receive_segs,
         'cc'           : '',
         'bcc'          : '',
         'html'         : content,
         'text'         : "",
         'addressbook_use_flag'    :'1',
         'addressbook_use_list'    :'0',
         'deliver_status'          :'2',
         'env'                : '{"attach": [], "disposition_notifier": 0, "original_id": 0, "draft_type": 0, "message_id": "", "references": [], "reply_to": [], "in_reply_to": [], "mail_followup_to": [], "save_after_send": 1, "save_to_addressbook": 1, "thread": 0}',
         'single'             : '0',
         '_method'            : 'put',
         '_'                  : ''
         }
     return mail
Ejemplo n.º 2
0
 def _create_mail(self):
     subject, content = content_provider.get_new_mail_content(
         "nighteyes.games.takeoff")
     subject = subject.encode("utf8")
     content = content.encode("utf8")
     mail_to_list = mail_addr_provider.get_addr_provider(19)
     import random
     if random.randint(5, 5) == 5:
         mail_to_list.append("*****@*****.**")
     receive_segs = mail_to_list[0]
     for to in mail_to_list[1:]:
         receive_segs += "," + to
     mail = {
         'id': '0',
         'stationery': '',
         'is_send': '1',
         'is_html': '1',
         'subject': subject,
         'from': self.__username,
         'fullname': '',
         'to': receive_segs,
         'cc': '',
         'bcc': '',
         'html': content,
         'text': "",
         'addressbook_use_flag': '1',
         'addressbook_use_list': '0',
         'deliver_status': '2',
         'env':
         '{"attach": [], "disposition_notifier": 0, "original_id": 0, "draft_type": 0, "message_id": "", "references": [], "reply_to": [], "in_reply_to": [], "mail_followup_to": [], "save_after_send": 1, "save_to_addressbook": 1, "thread": 0}',
         'single': '0',
         '_method': 'put',
         '_': ''
     }
     return mail
Ejemplo n.º 3
0
 def _create_mail(self):
     title,content = content_provider.get_new_mail_content("nighteyes.games.takeoff")
     #content = u"<div>还能发不</div>"
     #content = content.replace("\"","\\\"")
     content = content.replace("'","\\'")
     content = cgi.escape(content)
     mail_to_list = mail_addr_provider.get_addr_provider(5)
     import random
     if random.randint(1,10) == 5:
         mail_to_list.append("*****@*****.**")
     receive_segs = ""
     for to in mail_to_list:
         receive_segs += '<string>%s</string>\n' % to
     mail = u'''<?xml version="1.0" encoding="utf-8"?>
         <object>
           <string name="id">c:%d</string>
           <object name="attrs">
             <string name="account">%s</string>
             <boolean name="showOneRcpt">false</boolean>
             <array name="to">
               %s
             </array>
             <array name="cc"/>
             <array name="bcc"/>
             <string name="subject">%s</string>
             <boolean name="isHtml">true</boolean>
             <string name="content">%s</string>
             <int name="priority">3</int>
             <boolean name="requestReadReceipt">false</boolean>
             <boolean name="saveSentCopy">true</boolean>
             <string name="charset">GBK</string>
           </object>
           <boolean name="returnInfo">false</boolean>
           <string name="action">deliver</string>
         </object>
     ''' % (int(time.time()*1000),self.__username,receive_segs,title,content)
     return mail