R
R
Ruslan Absalyamov2018-06-19 11:33:57
1C-Bitrix
Ruslan Absalyamov, 2018-06-19 11:33:57

Mail is not sent on Bitrix, how to set it up?

I have vmbitrix 7 on the virtual machine. But I haven’t caught up with why my mail is not sent.
In php-console already entered

if(mail("[email protected]", "TEST SUBJECT", "TEST BODY"))
echo "Почтовая система работает!";
else
echo "Неудача, почтовая система не работает, попробуйте еще!";

And it comes out "Failure, the mail system is not working, try again!"
Created a .msmtprc file in the root of the site and registered it there
account default
logfile /home/bitrix/www/.msmtp.log
host mail.bitrixsoft.com
port 25
from [email protected]
auth off

But the .msmtp.log file was not created, I had to manually create it, but without success.
What should I do?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nikita, 2018-06-19
@Rema1ns

Not quite a correct question, judging by the listing, the mail () function does not work for you, and as a result, mail is not sent.
Check all necessary settings, including sendmail path settings, link
Next, you need to form additional_headers
normally Like this

$headers = "MIME-Version: 1.0\n";
$headers .= "From: =?$charset?B?".base64_encode($fromName)."?= <$from>\n";
$headers .= "Content-type: text/html; charset=$charset\n";
$headers .= "Content-Transfer-Encoding: base64\n";

If the mail was sent, but did not reach the addressee, we look at the mx, spf, dkim records

A
Alexander, 2018-06-19
@idruweb

try using the menu (menu.sh) to configure mail

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question