简体   繁体   English

Sendmail路径错误?

[英]Sendmail path error?

I just switched to using Msmpt, but I am unable to send using the mail() function. 我刚刚切换为使用Msmpt,但是无法使用mail()函数进行发送。 I can send via SSH command line perfectly but var_dump shows that mail returns a false value. 我可以完美地通过SSH命令行发送,但是var_dump显示邮件返回了错误的值。

sendmail_path = /usr/bin/msmtp -t -i

Is the path, but manually browsing, I am unable to locate "msmtp". 是路径,但是手动浏览,我无法找到“ msmtp”。 Any ideas how to find where it is located so I am able to correct the sendmail path? 任何想法如何找到它的位置,以便我能够更正sendmail路径?

Typing 打字

which msmtp

from the command line should return the path to msmtp. 从命令行应将路径返回到msmtp。

I dont have any experience with msmtp but tried many smtp server types.. 我没有使用msmtp的经验,但是尝试了许多smtp服务器类型。

At first, does your smtp require authentication (for your host. maybe its' localhost, but it's up to configuration.) if yes. 首先,如果是,您的smtp是否需要身份验证(对于您的主机。也许是其本地主机,但要取决于配置。)。 you may need to use a php smtp library with authentication. 您可能需要使用带有身份验证的php smtp库。 there is one in pear http://email.about.com/od/emailprogrammingtips/qt/et073006.htm Check the link use the sample code. 梨子里有一个http://email.about.com/od/emailprogrammingtips/qt/et073006.htm检查链接使用示例代码。 Trying to send a mail via sockets (! notice that not mail() function) will tell you much more diagnostic information. 尝试通过套接字发送邮件(!请注意,不是mail()函数)将告诉您更多的诊断信息。 if you dont have pear installed check phpmailer library in sourceforge.net. 如果您没有安装pear,请在sourceforge.net中检查phpmailer库。 i use phpmailer which is much easier to use than pear. 我使用的phpmailer比梨更容易使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM