How to send email from Bitrix using msmtp?

Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
Hi, I have Bitrix24 trial on premise installed. Everything runs OK including email receiving. But I can´t send any email using msmtp. I checked msmtp via CLI and runs OK. Seems like Bitrix doesn´t communicate with msmtp. Where to start? Thank you.
by (140 points) | 88 views

1 Answer

0 like 0 dislike

The reason is that the home catalog of the scripts is set in HOME=/, which is why the messages to be sent through a Cron job fail to send.
In order to solve the problem, you have to:

  • Create a symbolic link with /home/bitrix/.msmtprc at /etc/msmtprc – the configuration file /etc/msmtprc is a system file for the utility and permits to decide on the configuration file location with such a HOME parameter.
  • Or update BitrixVA to version 5.0.46 or higher.

You can configure the mail server in the Bitrix virtual appliance menu.

  • Select Mail sending system parameters by typing 1 and pressing Enter:

Having acquired the options, the configuration screen will show them for review:

    • Select Yes to save changes.
  • The Bitrix appliance will show the SMTP configuration prompt

  • Specify here the following parameters:

    • SMTP server name - the address of the SMTP server used for outgoing messages.
    • SMTP port - the mail server port: 25 for insecure connection and 465 for secure SSL connection.
    • Default sender address - specifies the address that will be substituted in the e-mail message.
    • SMTP authorization required – type y if you require more security (for example, to avoid unauthorized spamming).
by (380 points)

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
28,158 users