S
S
Stanislav2017-04-01 08:23:55
linux
Stanislav, 2017-04-01 08:23:55

What is the best way to enable php to send email?

The situation is this - there is a new server on Debian 8. It will be necessary to run various php scripts on it. To do this, apache, mysql, proftp, ssh were raised on it, and in fact that's all for now. The situation is such that if you now try to send some mail through the php-function mail (), then nothing happens. Ports are now configured like this:

[email protected] ~ # netstat -pnlt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      579/sshd
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      1093/mysqld
tcp6       0      0 :::21                   :::*                    LISTEN      21842/proftpd: (acc
tcp6       0      0 :::22                   :::*                    LISTEN      579/sshd
tcp6       0      0 :::80                   :::*                    LISTEN      19716/apache2

It seems to be obvious that you need to open port 25. If this is important, then authorization for sending mail is not required yet, but in the future it will most likely come in handy, and an external smtp server will most likely be used, and not your own (Yandex, Gmail, etc.).
Question: is it worth opening it just through the firewall, or will it be the wrong way and you need to install Postfix, for example?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dummyman, 2017-04-01
@lamo4ok

What about listening ports?
all the settings you need to change for mail() to work are in php.ini
If you want your own server, install exim. Again, it is not necessary to open ports for it if it will only work for sending.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question