R
R
Roma2019-03-29 12:16:13
linux
Roma, 2019-03-29 12:16:13

How to send mail from php scripts without losing emails if the mail server is not available?

Colleagues, good afternoon.
Help, please, in resolving the issue.
There is a site on Bitrix. ssmtp is used to send mail (via php's mail() function).
The mail server (Postfix) costs in other place, territorially.
Website and mail server in the same domain (www.example.com and mail.example.com, respectively).
The problem is that if the mail server is not available for any reason, then the letter that poisons the site is lost and does not reach the recipient, because ssmtp does not queue or resend.
Tell me how to replace ssmtp and how to configure it correctly?
I understand that you need to install a full-fledged MTA, for example, postfix. It needs to be configured as relay? In this configuration, will it queue and resend messages that could not be delivered to the mail server (for example, with a connection timeout)?
Or maybe there is something better?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
ky0, 2019-03-29
@Angel2S2

Yes, put MTA, it will try to send to a successful end (well, or how you set it up).

L
Lone Ice, 2019-03-29
@daemonhk

I don’t know if it’s easier or not, but you can queue all letters by making an entry in the database, check the availability of the server (here I don’t know exactly how), send a letter and delete the entry from the database.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question