• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

How i can active mail() function?

Mohammadreza

Basic Pleskian
Hi dear
i installed plesk 12 on the Windows 2010 OS
and installed WordPress,
now i cant Send Email and show me this error:
Possible reason: your host may have disabled the mail() function

-----------
please help me how i can Config it's?
 
I don't have any issues with the mail function. Make sure your server is configured properly for sending out emails (if using mailenabled, make sure you have proper DNS settings set in the mailenabled settings). Then create a PHP file named testmail.php and put in the following:

Code:
<?php 
    ini_set( 'display_errors', 1 );
    error_reporting( E_ALL );
    $from = "emailtest@YOURDOMAIN";
    $to = "YOUREMAILADDRESS";
    $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";
?>

Place the file in your httpdocs and in a web browser go to where the file is at (http://yourdomain.com/testmail.php)

If successful then there's an issue with WordPress configuration that you should search online for. Otherwise you should be getting an error stating what the actual issue is.
 
thanks for your help
i'm try it's but show this error:
error 500
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator to inform of the time the error occurred and of anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

how i can solved this problem?


thank you
 
dear
i'm try again and show this error:

Warning: mail(): SMTP server response: 503 This mail server requires authentication when attempting to send to a non-local e-mail address. Please check your mail client settings or contact your administrator to verify that the domain or address is defined for this server. in D:\Inetpub\vhosts\mydomain.com\httpdocs\testmail.php on line 9
Test email sentPHP Warning: mail(): SMTP server response: 503 This mail server requires authentication when attempting to send to a non-local e-mail address. Please check your mail client settings or contact your administrator to verify that the domain or address is defined for this server. in D:\Inetpub\vhosts\mydomain.com\httpdocs\testmail.php on line 9
 
If you followed the first link it walks you through installing the failed request tracing and configuring it.

In terms of the error that you're getting, it's telling me your server requires authentication. You can configure it so anything being sent from the local server doesn't required authentication logging into plesk, click on Server then Mail Server Settings. From there look for "Use no relay restrictions for the following networks" and add 127.0.0.1 (which is the loop back address). That should resolve that problem.
 
thanks for Your Reply
i'm set that's,and now show this error:


Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in D:\Inetpub\vhosts\panel-host.com\httpdocs\testmail.php on line 9
Test email sentPHP Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in D:\Inetpub\vhosts\panel-host.com\httpdocs\testmail.php on line 9

and i check smtp port in php.ini(C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP54) port smtp is 25

now what i do?

thank you
 
Either the mail server is not running or port 25 isn't open on your firewall. Ensure your email server is running and ensure port 25 is open in the windows firewall.
 
thanks for your reply,
i check and port is open
and i check port in ping.eu
i dont konw whats the problem :(
 

Attachments

  • portsmtp.png
    portsmtp.png
    18 KB · Views: 4
Well the main question is: what email server are you even using? Cause depending on the answer will depends on the configurations.
 
my mail Server is Mail Enable
i checked in Mail Server Settings on Admin plesk
but not send Email,
how i can solved ?
thanks
 
Back
Top