简体   繁体   English

Bootstrap PHP联系人表单不发送电子邮件?

[英]Bootstrap PHP Contact Form Not Sending Email?

I have done several searches, and I'm not entirely sure what the problem is. 我已经进行了几次搜索,但我不确定是什么问题。 Im using bootstrap and a php contact form for a user to input data. 我使用引导程序和php联系人表单供用户输入数据。 This was my reference to building that form: http://rosstanner.co.uk/2012/11/build-simple-contact-form-html-php-bootstrap/ 这是我对构建该表单的引用: http : //rosstanner.co.uk/2012/11/build-simple-contact-form-html-php-bootstrap/

Im able to successfully post in the form, and receive my success or failure alert. 我能够成功地在表单中发布,并收到我的成功或失败警报。 However, the email is not actually being sent. 但是,实际上并未发送电子邮件。 My email is in the php file that the form is being redirected to, but is not receiving anything (yes I have checked my spam). 我的电子邮件在表单被重定向到的php文件中,但是没有收到任何信息(是的,我已经检查了我的垃圾邮件)。

I want to check if there is something server side I am missing (module wise for php). 我想检查是否缺少我缺少的服务器端(针对php的模块)。 I've just installed LAMP and left it at that. 我刚刚安装了LAMP,然后将其留在了那里。 The site works fine, but the form wont post an email. 该网站工作正常,但该表格不会发布电子邮件。

Thanks! 谢谢!

Without seeing your setup and code, and by looking at the link in your post, I would guess that your PHP.ini file is not setup. 在没有看到您的设置和代码的情况下,并且通过查看帖子中的链接,我猜您的PHP.ini文件未设置。

For PHP to be able to send a mail it will need to use an SMTP server. 为了使PHP能够发送邮件,它将需要使用SMTP服务器。 I know a lot of people use Googles (if you have an account) as it's pretty trusted. 我知道很多人都在使用Google(如果您有帐户),因为它值得信赖。

There is a great article on setting up your PHP.ini file below: http://www.quackit.com/php/tutorial/php_mail_configuration.cfm 以下是有关设置PHP.ini文件的精彩文章: http ://www.quackit.com/php/tutorial/php_mail_configuration.cfm

Another alternative is to install your own mail server. 另一种选择是安装自己的邮件服务器。 But I wouldn't necessarily recommend this due to problems with SPAM if it is not secured properly. 但是由于SPAM的问题,如果保护不当,我不一定会推荐这样做。

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

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