开发者

PHPmailer reports: Could not execute: /usr/sbin/sendmail

Why? I can send via mail() in PHP but I can't 开发者_JS百科send via PHPMailer using IsSendmail()


I've had the same error. Solved it by commenting/deleting this:

$mail->IsSendmail();

Now it works correctly. I can send mails, and I receive them in my inbox.


Are you sure the path /usr/sbin/sendmail is correct?

If yes, check also the permissions for sendmail are set correctly.


I had this same issue. Spent almost an hour checking logs, checking sendmail paths and testing php mail() and sendmail from command line to no avail. And finally all I did was restarted Apache using apachectl -k graceful and the universe was healed.


For me it's working with $mail->IsSMTP(). IsSendmail() is looking for sendmail.


I agree with the bloc above. The default mail() function is enabled on all servers (i believe). In my case I was able to send basic html using the simple mail() function but when I used PHPMailer to do that I had that error.

So I removed the part where it checks i.e. IsSendMail() and all was fine. Now more exception thrown.

For people who want to use SMTP. First create an email account on your sever and then define its parameter in your code.

Cheers,

Talha


Removing IsSendmail() just created another error for me, in the end the host provider had to remove safemode on the PHP settings. It then worked

Edit By David Burdess

SafeMode should not be set on a live server! For example sites that run on Joomla or other CMS solutions it should not be enabled except in a testing environment


PHP with enabled safe_mode on shared servers (and probably on others too) will fail to open /usr/sbin/sendmail (PHPMailer uses popen)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜