简体   繁体   English

如何使“发送电子邮件”按钮在 Boostrap 模板中起作用?

[英]How do i make the "Send email" button work in a Boostrap template?

For my website, i use a free template form startbootstrap.com, in this template there is a "Send Mail" button, i tried to get it running, but it doest, work.对于我的网站,我使用了一个免费的模板表单 startbootstrap.com,在这个模板中有一个“发送邮件”按钮,我试图让它运行,但它没有工作。 How can i make it work?我怎样才能让它工作?

I have already changed the mailto@something.com to my real email and it didnt work.我已经将 mailto@something.com 更改为我的真实电子邮件,但它不起作用。 I am not very experienced in web developing, so it might be a very simple thing.我在网络开发方面不是很有经验,所以这可能是一件非常简单的事情。 Any help would be much appreciated任何帮助将非常感激

Here is the code section for the email part: \\n The only line i changed was :这是电子邮件部分的代码部分:\\n 我更改的唯一行是:

action="mailto:myreal@mail.com" method="POST" enctype="text/plain"> action="mailto:myreal@mail.com" method="POST" enctype="text/plain">

This section tells me that i should configure my web server differently if things dont work, how would i do that这部分告诉我,如果事情不工作,我应该以不同的方式配置我的网络服务器,我将如何做到这一点

 <!-- The form should work on most web servers, but if the form is not working you may need to configure your web server differently. -->

I expected this part, to just send an email to me from the provided email addres with the given content, but when i try to run it it says:我希望这部分只是从提供的电子邮件地址向我发送一封包含给定内容的电子邮件,但是当我尝试运行它时,它说:

Sorry, it seems that my mail server is not responding.抱歉,我的邮件服务器似乎没有响应。 Please try again later!请稍后再试!

Thanks in advance!提前致谢!

I don't know which template you have chosen, but with "Freelancer" there's a contact_me.php located under mail folder, where you should configure this part:我不知道您选择了哪个模板,但是对于“Freelancer”,邮件文件夹下有一个 contact_me.php,您应该在其中配置这部分:

$to = "yourname@yourdomain.com"; // Add your email address inbetween the "" replacing yourname@yourdomain.com - This is where the form will send a message to.
$subject = "Website Contact Form:  $name";
$body = "You have received a new message from your website contact form.\n\n"."Here are the details:\n\nName: $name\n\nEmail: $email\n\nPhone: $phone\n\nMessage:\n$message";
$header = "From: noreply@yourdomain.com\n"; // This is the email address the generated message will be from. We recommend using something like noreply@yourdomain.com.
$header .= "Reply-To: $email";

Since you need php and mail server for this to work, after configuration you can deploy it to a server like xampp or wampp if you'd like to test it locally or just copy it to a real webserver.由于您需要 php 和邮件服务器才能工作,因此在配置后,如果您想在本地测试它或将其复制到真正的网络服务器,则可以将其部署到 xampp 或 wampp 等服务器。

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

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