简体   繁体   English

PHPMailer可在WAMP上使用,但不能在生产服务器上使用

[英]PHPMailer Works on WAMP but not on Production Server

Hello I'm trying to use PHPMailer to send emails via SMTP. 您好,我正在尝试使用PHPMailer通过SMTP发送电子邮件。 So, on my development server (WAMP on my computer), it works fine. 因此,在我的开发服务器(计算机上的WAMP)上,它工作正常。 The mail server I use is mail.jackbusch.net which is on the same shared host that I am going to upload the site to for production. 我使用的邮件服务器是mail.jackbusch.net,它位于将站点上传到生产环境的同一共享主机上。

But when I DO upload the website, PHP mailer stops working and returns SMTP: Error: Could Not Authenticate (when I try to use localhost as the server) and SMTP Error: Could Not Connect (when I type in the full smtp server name--ie mail.jackbusch.net). 但是,当我上载网站时,PHP邮件程序停止工作并返回SMTP:错误:无法验证(当我尝试使用localhost作为服务器时)和SMTP错误:无法连接(当我键入完整的smtp服务器名称时- -ie mail.jackbusch.net)。

This seems odd to me since I have several Wordpress installations that send email notifications just fine--and WP uses Phpmailer, correct? 这对我来说很奇怪,因为我有多个安装了Wordpress的Wordpress安装程序,而且WP使用Phpmailer,对吗?

I don't even know where to begin on fixing this? 我什至不知道从哪里开始解决这个问题?

EDIT: Thanks for your suggestions--I ended up just using the PEAR Mail package and it works perfectly fine. 编辑:谢谢您的建议-我最终只使用了PEAR Mail程序包,它的工作原理非常好。

I used the second example shown here: http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm 我使用了此处显示的第二个示例: http : //email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm

I think one key difference is that before I was using Port 26, and the second time I was using the SSL port for my web host (a small orange). 我认为一个主要的区别是,在我使用端口26之前,以及第二次使用Web主机(一个橙色的端口)使用SSL端口。 For whatever reason, it all worked out this time. 无论出于什么原因,这次都解决了。

使用的是PEAR Mail软件包,而不是此处显示的SSL示例: http : //email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm

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

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