7
7
700ghz2016-03-16 22:23:22
Python
700ghz, 2016-03-16 22:23:22

How to send emails from VPS?

Hi!
The backend server of a small online store on Python+Flask should send order notifications to the customer (2-3 messages per day).
The server will spin on VDS.
How to implement it correctly?

  1. If you use an external SMTP server, which one would you recommend (so that it reliably allows you to log in and send letters, and not reject me as a spammer robot)?
  2. Raise to SMTP server on VDS? (And what, letters will directly reach mail.ru, gmail, yandex etc???) Hosting should provide something for this?

Thank you in advance!
PS It was supposed to use Gmail SMTP to send emails, but I immediately ran into instability: the Google server suddenly decided not to give authorization to my backend until I logged in through the browser.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
C
Cool Admin, 2016-03-16
@700ghz

Let's get straight to gmail. He didn't give you auth and told you how to fix it in a bug. You just read the text of the error, follow the link from it and enable "Insecure authorization" and everything will work for you. you can't do better for sending mail with a guarantee. But. If you decide. That.
You need:
1. Domain, it has A records on the mailman, MX records on the A record
2. PTR record at the hosting, that there is definitely that A record from p1 behind your white IP address.
3. Sender-ID record and record _ep (aka SPF), dmrac record - these are all records with the TXT type. Google each one.
4. It would be nice if the postman knew how to sign DKIM, and it was configured.
If you do all this, there will be both txt and html versions in the body of the letters, the latter will not have errors in the code, there will be alt for all pictures and in general it will be tidied up - you will get a good positive anti-spam rating.
Like mine, but better223861dc36414aab88404c457ff17b38.png

O
Oleg Burca, 2016-03-17
@Cram

If on a Linux server, install SSMTP and bind to Gmail.
SSMTP setup here: https://wiki.archlinux.org/index.php/SSMTP

M
marataziat, 2017-04-29
@marataziat

In order not to be hemorrhoids with DNS and SMTP settings, it is better to use the Y service

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question