How to lunch webpage without using SMTP server?

Byron DesertLinux at netscape.net
Wed Jul 21 14:09:37 EDT 2004


Hi Nancy,

In order to be able to send an e-mail, you need to use either an SMTP 
server or have the know-how skill to be able to route the message 
yourself.  I would HIGHLY recommend that you use an SMTP server.

Here's a code snipplet that you might find helpful:

	def sendmessage(toaddr, fromaddr, message):
		server = smtplib.SMTP('mail.some-server.com')
		server.login("webmaster at some-server.com", "mySecretPassword")
		server.sendmail(fromaddr, toaddr, message)
		server.quit()

You can use this function by doing the following:

	sendmessage("byron at somewhere.com", "nancy at anotherplace.com", "Let's 
have lunch someday via smtp! <grin>")

Hope this helps,

Byron
-----------------------



Nancy wrote:

> Hi, Guys,
>   Is there any other way to use python or mod_python writing a web page?
> I mean, not use "form.py/email", no SMTP server.
>    <form action="form.py/email" method="POST"> ...
>    
>   Thanks a lot.
> 
> Nancy W



More information about the Python-list mailing list