PHP Mail not sending e-mails

44 views
0

I have problem, i try to use mail() function but e-mails are not received.

I have simple script for testing:

$content = 'Message text';
$header = "From: xxx@abcd.plrnReply-To: xxx@abcd.plrnContent-type:text/html; charset=UTF-8";
mail('xxx123@gmail.com', 'E-MAIL TOPIC', $content, $header)

My hosts:

::1         localhost localhost.my.domain
127.0.0.1       localhost localhost.my.domain

My hostname:

abcd.pl

maillog

Dec  3 00:49:40 localhost sendmail[22741]: vB2NnerC022741: from=www, size=347, class=0, nrcpts=1, msgid=<201712022349.vB2NnerC022741@abcd.pl>, relay=www@localhost
Dec  3 00:49:40 localhost sm-mta[22742]: STARTTLS=server, relay=localhost [127.0.0.1], version=TLSv1.2, verify=NO, cipher=DHE-RSA-AES256-GCM-SHA384, bits=256/256
Dec  3 00:49:40 localhost sendmail[22741]: STARTTLS=client, relay=[127.0.0.1], version=TLSv1.2, verify=FAIL, cipher=DHE-RSA-AES256-GCM-SHA384, bits=256/256
Dec  3 00:49:40 localhost sm-mta[22742]: vB2NneiG022742: from=<www@abcd.pl>, size=586, class=0, nrcpts=1, msgid=<201712022349.vB2NnerC022741@abcd.pl>, proto=ESMTPS, daemon=IPv4, relay=localhost [127.0.0.1]
Dec  3 00:49:40 localhost sendmail[22741]: vB2NnerC022741: to=xxx123@gmail.com, ctladdr=www (80/80), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30347, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (vB2NneiG022742 Message accepted for delivery)
Dec  3 00:49:40 localhost sm-mta[22744]: STARTTLS=client, relay=gmail-smtp-in.l.google.com., version=TLSv1.2, verify=FAIL, cipher=ECDHE-RSA-AES128-GCM-SHA256, bits=128/128
Dec  3 00:49:41 localhost sm-mta[22744]: vB2NneiG022742: to=<xxx123@gmail.com>, ctladdr=<www@abcd.pl> (80/80), delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=30586, relay=gmail-smtp-in.l.google.com. [IPv6:2a00:1450:400c:c0a::1b], dsn=5.0.0, stat=Service unavailable
Dec  3 00:49:41 localhost sm-mta[22744]: alias database /etc/mail/aliases.db out of date
Dec  3 00:49:41 localhost sm-mta[22744]: vB2NneiG022742: vB2NnfiF022744: DSN: Service unavailable
Dec  3 00:49:41 localhost sm-mta[22744]: vB2NnfiF022744: to=<www@abcd.pl>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31610, relay=local, dsn=2.0.0, stat=Sent

Well, i guess i have to configure hosts for resolving my domain?
I tried to do that but it didn’t worked too.

I’am using almost clean Freebsd 10.3, PHP 7.0.
Any ideas?

What is neccesary to simply send e-mail succesfully?