S
S
step-olga2015-10-14 20:18:19
PHP
step-olga, 2015-10-14 20:18:19

How to set up an Apache server to send emails using PHP mail()?

There is an apache server on Ubuntu 14.04 LTS, sendmail and php-mail are installed, the path to sendmail is registered in the php.ini file, but letters on the feedback page are not sent via mail (). What could be the problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
SilverSlice, 2015-10-15
@step-olga

At a minimum, your hostname is configured incorrectly, so the server is not accepting your message.
The easiest way would be to install PHPMailer and send emails via smtp of the same rambler.
If you still want your own mail server, then you need to register the hostname, as well as set up PTR and SPF records. Here are links to help you:
https://www.linode.com/docs/getting-started#settin...
geektimes.ru/post/59417
habrahabr.ru/post/101628
After that, you can check the mail sending using the mail -tester.com by sending an email from the console:

echo "This is a test." | mail -s Testing [email protected]

A
Alexey Skobkin, 2015-10-14
@skobkin

Apache has nothing to do with it.
You can try replacing sendmail with exim4 (it also provides a compatible sendmail binary). Well, look at the logs, yes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question