I want to make mail()
of PHP work in my Windows Server 2012 R2
. To this end, I first installed SMTP
by following this page.
One thing that confuses me is the Full-qualified domain name
. WIN-RFELH8GM0KN
is what it proposes by default. My server hosts several websites, does anyone know which website I should specify here?
I did not change this, as a consequence, mail www.google.com
in nslookup
returns DNS request timed out.
So is it an error?
Of cause, my test.php
does not send the mail:
<?php
mail('mymail@gmail.com', 'title', 'content');
?>
Could anyone help?
Update 1 Following the answer of @LittleAI , I started SMTP, but DNS request timed out
is still there:
Update 2 Here is php.ini
:
telnet localhost 25
returns the follows:
Update 3 Here was a test, which worked well: I did receive the test mail in the inbox of softtitmur@gmail.com
. However, if I redo the test in Update 1
, there is still DNS requested time out.
. And test.php
still cannot send the mail...
Update 4 I just realised that in the page I followed, it is mail.vsysad.com
under nslookup
(I thought it was mail vsysad.com
, that is why i tried mail www.google.com
which did not make sense). So it works also in my server, and there is no DNS request timed out
.
Then, I double checked php.ini
, I realised that sendmail_from
was not uncommented. So I uncommented it and set sendmail_from = softtimur@gmail.com
, as a result, mail()
of php works now, so the problem is solved, though I still don't understand FQDN and its default value (ie, WIN-RFELH8GM0KN
)...