Changeset View
Changeset View
Standalone View
Standalone View
test-wallace.py
Show All 19 Lines | |||||
import smtplib | import smtplib | ||||
import socket | import socket | ||||
import sys | import sys | ||||
# For development purposes | # For development purposes | ||||
sys.path.extend(['.', '..']) | sys.path.extend(['.', '..']) | ||||
from email.MIMEMultipart import MIMEMultipart | from email.mime.multipart import MIMEMultipart | ||||
from email.MIMEBase import MIMEBase | from email.mime.base import MIMEBase | ||||
from email.MIMEText import MIMEText | from email.mime.text import MIMEText | ||||
from email.Utils import COMMASPACE, formatdate | from email.utils import COMMASPACE, formatdate | ||||
from email import Encoders | |||||
def send_mail(send_from, send_to, send_with=None): | def send_mail(send_from, send_to, send_with=None): | ||||
smtp = smtplib.SMTP("localhost", 10026) | smtp = smtplib.SMTP("localhost", 10026) | ||||
smtp.set_debuglevel(True) | smtp.set_debuglevel(True) | ||||
subject = "This is a Kolab load test mail" | subject = "This is a Kolab load test mail" | ||||
text = """Hi there, | text = """Hi there, | ||||
sicherha: All these modules are available in Python 2.7. Drop the `try`-block and use only the `import`s… | |||||
I am a Kolab Groupware test email, generated by a script that makes | I am a Kolab Groupware test email, generated by a script that makes | ||||
me send lots of email to lots of people using one account and a bunch | me send lots of email to lots of people using one account and a bunch | ||||
of delegation blah. | of delegation blah. | ||||
Your response, though completely unnecessary, would be appreciated, because | Your response, though completely unnecessary, would be appreciated, because | ||||
being a fictitious character doesn't do my address book of friends any good. | being a fictitious character doesn't do my address book of friends any good. | ||||
Kind regards, | Kind regards, | ||||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |
All these modules are available in Python 2.7. Drop the try-block and use only the imports from the except-block.
Also, I think Encoders isn't used anywhere in this file, so we can probably drop that line.