Changeset 183 for foomailer


Ignore:
Timestamp:
Sep 22, 2010, 5:36:11 PM (14 years ago)
Author:
Rick van der Zwet
Message:

Allow setting elho and helo as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • foomailer/foomail.py

    r2 r183  
    113113
    114114email = MIMEMultipart()
     115hostname = socket.gethostname()
    115116
    116117email['From'] = 'Testing sender <' + sender + '>'
     
    119120    email['Cc'] = cc
    120121email['X-Server'] = server
    121 email['X-Hostname'] = socket.gethostname()
     122email['X-Hostname'] = hostname
    122123email['Message-ID' ] = '<' +''.join(random.sample(string.letters +
    123124                       string.digits,10)) + '@' + email['X-Hostname'] + '>'
     
    192193    mark = time.time()
    193194    server = smtplib.SMTP(server)
    194     server.set_debuglevel(0)
     195    server.helo(hostname)
     196    server.ehlo(hostname)
     197    server.set_debuglevel(1)
    195198    server.sendmail(sender, recipient, email.as_string())
    196199    server.quit()
Note: See TracChangeset for help on using the changeset viewer.