Answer the question
In order to leave comments, you need to log in
How to set up sending emails from VPS?
Good day!
I'm trying to transfer the site to 1C-Bitrix on VPS (Beget). Configuration: Ubuntu and Vesta CP. No experience with servers. Faced a problem: letters with notifications do not come.
1. Looked at the b_event table - it shows that the letter has been sent
2. Tried to send a test letter through the mail () function; The function returns true that the message has been sent, but there is no letter in the mail.
3. Connected via SSH - executed sudo php -r "mail('[email protected]', 'Test, 'Test');" - letter came.
4. There are no errors in the mail logs (I registered the path to the logs in php.ini) Sendmail_path is registered in php.ini
. In which direction to dig, tell me?
PS I noticed a feature - the mail () function works 1 time after the server is rebooted - once the letter arrives, then they do not.
Answer the question
In order to leave comments, you need to log in
1. Make sure sendmail_path is configured and working.
Here are the approximate settings for $domain_name - your domain, respectively. For example website.com
[HOST=$domain_name]
sendmail_path = /usr/sbin/sendmail -t -i -f [email protected]$domain_name"
2. Make sure you configure php.ini for the PHP that is used on the site Create a
file with any name in the root of the site, for example myinfo.php and enter the code there:
<?php
phpinfo();
Save the file and open the file in the browser: your_domain/myinfo.php
In the window that opens, find the value of the sendmail_path parameter
. Check the logs of the mail server.When
sending a letter, there will definitely be sending logs:
For example, tail on the log and send a letter.
tail -f /var/log/exim/mail.log
Something like this: exim4. Setting up an SMTP server for our web server .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question