cannot initiate mail function in joomla

跟風遠走 提交于 2019-12-08 08:32:15

问题


I am getting this error in Joomla while sending the mail.

I am not getting this error every time. But some times its shows me "cannot initiate mail function".

Any solution for this?


回答1:


That could be any number of things, but a general list of things to check would be first, your Joomla config:

Admin panel > Global Configuration > Server > Mail Settings > Mailer

Make sure that's set to use the PHP mail function. If it is, try making a script called test.php and putting it in the root of your site (where the index.php file is for Joomla). Make that file something like this:

<?php

$to = "you@youremailaddress.com";
if( mail( $to , 'This is a test message.' , 'Is this working?' ) ) {
    echo 'Email sent.';
} else {
    echo 'Email failed to send.';
}

?>

Make sure you change the $to = line to your email address. Now go to that script: http://www.yourjoomlasite.com/test.php You should see the text 'Email sent.' in your browser and then receive an email to that address you entered. If not, then you should contact your hosting provider and ask them to upgrade to the latest PHP version and/or resolve the mail() function issue for you. That is the most raw implementation of sending mail via PHP and if that fails to work then it's got to be an issue with your host.




回答2:


If you are working in the local server, the mail will not initiate. So host your website in server and try it.

If you have any questions, let me know




回答3:


If you are using WAMP or similar on your own machine and are getting this message then you need to install a mail server. This is the best solution on Windows.

http://www.toolheap.com/test-mail-server-tool/



来源:https://stackoverflow.com/questions/7011622/cannot-initiate-mail-function-in-joomla

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!