using smtp in python

A

ashikbekal

I'm trying to send an email using python. The mail content is taken from file and subject of the mail is name of the file. The program is invoked as
./mailclient.py -f <from email address> -d <recipient email address> -i <file1> -s <server IP address>
..
How to i use server ip address and the mail id to send the email ? (would i require the password)
 
D

Dan Stromberg

I'm trying to send an email using python. The mail content is taken from
file and subject of the mail is name of the file. The program is invoked as
./mailclient.py -f <from email address> -d <recipient email address>
-i <file1> -s <server IP address>
.
How to i use server ip address and the mail id to send the email ? (would
i require the password)

Some SMTP servers require a password and some do not. I'm guessing more
and more do, as spammers attack.

Here's a module that shows how to do it with a password:
http://stromberg.dnsalias.org/svn/mailer/trunk/mailer.py

You can check it out with svn checkout <url>, or just browse to the URL in
a web browser.

HTH
 
C

Chris Angelico

POP3 before SMTP ?

Or just IP-based restrictions (computers on 192.168.0.0/24 may relay
mail, all others may only send to the domains managed here - same
approach as is often used for caching+authoritative DNS resolvers).

ChrisA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top