0

I want to write an email sending script in Python. Most email programs have to connect to existing servers, like Gmail or Hotmail. I want my script to work independantly of those servers and just be able to send email itself (without having to logon anywhere else). The reason for this is because most email servers (like Yahoo) limit what you can do, such as controlling the sender address or sending certain types of files. So I wanted to write my own script to get around that. So what do I do? Where do I begin learning how to do this? Do I have to write my own server? If I do, how is that done?

1
  • please don't. smtp is broken as it is, even without your attempts at it. Commented Jul 15, 2011 at 8:55

3 Answers 3

4

You need an MTA (a.k.a. mail transfer agent), whether it's local or remote. SMTP servers talk to each other to deliver the mail through — if you don't want to connect to the remote one, you need to run a local one. Look into Postfix or exim — just be careful not to allow random people to connect to it. Go to Server Fault if you need help with configuring them.

This is language-agnostic, BTW.

Sign up to request clarification or add additional context in comments.

Comments

0

The email-module of Python should give you a good starting point. Btw this was the first hit when googling Python email.

2 Comments

Yeah, I looked at a lot of places on the Internet. Almost all of them require me to log on to existing servers to send email, but I suppose that will get me started.
@user: smtplib can be used to send email directly to any SMTP-listener.
0

You'll essentially need to set up your own mail server. I prefer postfix but there are several alternatives, you'll have to google this one.

Once you can send email through your own server, look into smtplib or email-library for sending email with Python

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.