How to send mail from php scripts without any loss of emails, if not available mail server?
Colleagues, good afternoon.
Please help me in resolving the issue.
There is a site on Bitrix. To send mail use SMTP (via the mail() function of php).
Mail server (Postfix) is in a different place, geographically.
The website and the mail server in the same domain (www.example.com and mail.example.com respectively).
The problem is that if the mail server for any reason not available, then a letter, which poisons the website, lost and never gets to the recipient, because ssmtp does not turn and does not re-send.
Prompt, than to replace ssmtp and how to configure?
I understand that you need to put a full-featured MTA, e.g. postfix. It needs to be configured as a relay? In this configuration, whether it is to queue and re-send emails that failed to deliver to the mail server (for example, connection timeout)?
Or maybe there is something simpler?
Yes, set MTA, it will attempt to send to a successful end (or as customize).
Meggie95 answered on March 19th 20 at 09:12
Don't know, it's easier or not, but all email to queue up, making the entry in the database, you can check the availability of the server (here I don't know exactly how), send email and delete record from database.