1

I am using Debian 8 and I would like to be able to only send mail via python without installing a full blown mail server system like postfix or without using gmail.

I can only see tutorials to send mails with python with full mail system server or via gmail or other internet mail system. Isn't it possible to just send an email and don't care about receiving any?

Thanks.

3 Answers 3

2

You can run your own Python SMTPd server.

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

Comments

1

Well, you need a mail server. Either locally, on your machine, or somewhere on the internet. This doesn't have to be gmail.

Comments

1

You need to understand two things:

  1. "email" is a protocol. Read more about it here.
  2. in order to be able to "participate" in this protocol exchange you generally need a server that can "speak" the same protocol with other servers.

So no, you cannot send an email without some kind of server, either local or remote. As a "client" (the entity sending the email) you generally need to connect to a SMTP server in order to send or receive email. You can find more details about how to do this with Python in the standard SMTP library.

3 Comments

I know but I remember I was sending mails in the past with PHP without configuring any mail server. sending an email is a tcp packet and I think you can send it to an address where it will be name translated.
On a typical web server (so, of interest for PHP), the admins will have configured a local mail server that can be used by php applications to send emails.
@Richard as I've said above you need a server in order to "participate" in the protocol exchange. yes, the message that you send is a tcp packet (as every high level protocol uses it as the underlining protocol) but you have to use SMTP in order to communicate with the rest of the world.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.