Send mail using localhost smtp

phuongdzu

Verified User
Joined
Jul 24, 2013
Messages
26
Hello

I install DLE script (http://dle-news.ru)
I use PHP Mail() but some time it works, some time doesn't work. Users register but donot receive confirm link.
I test PHP Mail() as this Guide
Code:
    <?php 
        ini_set( 'display_errors', 1 );
        error_reporting( E_ALL );
        $from = "emailtest@YOURDOMAIN";
        $to = "[email protected]";
        $subject = "PHP Mail Test script";
        $message = "This is a test to check the PHP Mail functionality";
        $headers = "From:" . $from;
        mail($to,$subject,$message, $headers);
        echo "Test email sent";
    ?>
Run it and receive: Test email sent
But not any received

I want to change to send mail using localhost smtp but it doesn't work.
I see Exim is already running on
How to make it work with Directadmin
I don't know exactly but it may be send mail anonymously from localhost

==========
I read https://www.linode.com/docs/email/exim/deploy-exim-as-a-send-only-mail-server-on-ubuntu-12-04/
and I tested on another server (not directadmin). It works!
But I don't know how to do same on the server with Directadmin

Please help.
Thanks
 
Last edited:
Have you created the email address? How did you fill the settings for SMTP relay instead of phpmail?

You gave way too few info's to debug, so, i guess one or those:

1 - You didn't create the email address
2 - You're using wrong configuration settings

Regards
 
I tried install Nginx + PHP-FPM + MySQL + Exim as a Send-only Mail Server (as this guide: https://www.linode.com/docs/email/exim/deploy-exim-as-a-send-only-mail-server-on-ubuntu-12-04/) on test server.
I install DLE and this is setting on DLE Admin Panel:
Click to view image View attachment 2171
I didn't create any email.
It work perfectly but it doesn't work on server with Directadmin.
Can I remove Exim which installed with Directadmin Custombuild 2.0 and install as above guide?

Have you created the email address? How did you fill the settings for SMTP relay instead of phpmail?

You gave way too few info's to debug, so, i guess one or those:

1 - You didn't create the email address
2 - You're using wrong configuration settings

Regards
 
That's because DA doesn't allow unathenticated email send, is a security thing!

You need to:

1 - Go into DA Panel, create an email address
2 - Set that application this way:
Server: localhost (or mail.domain.tld)
Port: 587
User: Your newrly created email address
Pass: Password set on newrly created email address

That should work

Regards
 
Thank you
I change the information as your hints
1.png
When I sending via contact form it says:
This SMTP server does not support authorisation
2.png


That's because DA doesn't allow unathenticated email send, is a security thing!

You need to:

1 - Go into DA Panel, create an email address
2 - Set that application this way:
Server: localhost (or mail.domain.tld)
Port: 587
User: Your newrly created email address
Pass: Password set on newrly created email address

That should work

Regards
 
Thanks for your reply
I created email on Directadmin [email protected]
Domain phuongdzu.com is hosted on server.
This is information

I try SMTP host: mail.phuongdzu.com
Got same result: This SMTP server does not support authorisation
 
Last edited:
Sorry I thought you did create the email as amin user.

But authorization is not authentication. You should be able to set to don't use authorization.

Regards
 
Of course you can. You will risk to make your server insecure and ending with your server in some blacklist. I really don't suggest that way.

Directadmin server are quite strait light forward and you should be able easy to do everything with them.

I'm not at home now u if you want you can send me directadmin login details and also login details for that application and I can fix it for you as soon as I get home.

Up to you. But really I wouldn't suggest that approach.

Regards
 
@SeLLeRoNe
Many thanks for your help
After config, PHP Mail() still working some time and not woking some time
I tried send feedback email from some sites which hosted on server. Some received, some not
 
You shouldn't use PHP Mail function, i already told you.

I did configure the system to use SMTP and it was working.

Regards
 
It's probably the modsecurity i did install to make your server more secure.

You may need to review the logs to unedrstand which rule is blocking you.

Regards
 
Back
Top