[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] [Pygame] Sending E-Mail Through Python
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] [Pygame] Sending E-Mail Through Python
- From: luke p <rabidpoobear@xxxxxxxxx>
- Date: Sun, 6 Feb 2005 23:54:50 -0600
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Mon, 07 Feb 2005 00:55:23 -0500
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=EWjjaWdcZIfB4kQNhDmAaMVdfEzDRSK3YbSko5ZUco+4Xz1goSL33uRgxGV48wFvwqmwiNgKw//FH80bKC7AuQTPYyTYuofeWi1B12x5M/LFCesFvNgaQ/u5NRTA1t/QXDcfm7rBdhwRUBb1TWtvQhMni9mqTDkucsi5L8q9l3g=
- In-reply-to: <4206F545.9090608@xepher.net>
- References: <4206F545.9090608@xepher.net>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
I don't have a module named MIMEText.
This isn't really a pygame question though.
Actually it isn't at all a pygame question.
Unless you're making an email chess game that has a graphical
interface made with pygame or something.
which I doubt.
Anyway,
Cheers!
Wish I could be of more assistance.
By the way, you should make that chess game. that would be cool.
If you don't make it maybe I will.
On Sun, 06 Feb 2005 23:57:41 -0500, Kris Schnee <kschnee@xxxxxxxxxx> wrote:
> Any idea why the e-mail code provided in Python doesn't work for me?
> Running the function below gives me the error: "SMTPServerDisconnected:
> Connection unexpectedly closed." I think the problem is with the server,
> which in the example code just gives "localhost." Changing that to
> "www.xepher.net," my domain name, just hangs the program.
>
> Kris
>
> ## e-mail.py
> ## Mostly copied from Python docs (www.python.org).
>
> # Import smtplib for the actual sending function
> import smtplib
>
> # Import the email modules we'll need
> from email.MIMEText import MIMEText
>
> ONLINE = True
>
> def SendEMail(content, whofrom, to, subject=""):
> """Send an e-mail."""
>
> if not ONLINE:
> return
>
> # Create a text/plain message
> msg = MIMEText( content )
>
> msg['Subject'] = subject
> msg['From'] = whofrom
> msg['To'] = to
>
> # Send the message via our own SMTP server, but don't include the
> # envelope header.
> s = smtplib.SMTP("localhost")
> s.connect()
> s.sendmail(whofrom, [to], msg.as_string())
> s.close()
>
>