2
我创建了一个具有多个字段的表单的网站,并且我试图让按钮实际上向我发送输入的信息。我一直在努力学习代码学院的Mandrill API,但我可能会接受其他完成相同任务的方法。这是我到目前为止有:如何使用mandrill通过电子邮件发送表格信息
<div id="contactUs">
<div class="container">
<div class="row form-group">
<div class="col-sm-6">
<input class="form-control" id="email" placeholder="Your Email Address">
</div><!-- end col-sm-6 -->
<div class="col-sm-6">
<input class="form-control" id="organization" placeholder="Organization or Company Name">
</div><!-- end col-sm-6 -->
</div><!-- end form-group -->
<div class="row form-group">
<div class="col-sm-6">
<input class="form-control" id="name" placeholder="Your Name">
</div><!-- end col-sm-6 -->
<div class="col-sm-6">
<input class="form-control" id="phone" placeholder="Phone Number">
</div><!-- end col-sm-6 -->
</div><!-- end form-group -->
<div class="row form-group">
<div class="col-sm-12">
<button onclick="sendTheMail(); return false;" class="btn btn-default pull-right" id="alertMe">Contact Us</button>
</div><!-- end col-sm-6 -->
</div><!-- end form-group -->
</div><!-- end container -->
</div><!-- end contactUs -->
而且JS ..
// create a variable for the API call parameters
var params = {
"message": {
"from_email":"[email protected]",
"to":[{"email":"[email protected]"}],
"subject": "An Inquiry from your website",
"text": "Static text.. but how do i link the information entered in the fields to show up here?"
}
};
function sendTheMail() {
// Send the email!
m.messages.send(params);
}
必须有链接从田间地头到JS的信息的方式..即时通讯一个菜鸟还是..?任何提示,以获得更好的js ..请让我知道。
我会当我有时间去尝试这个今晚稍后..但由于一吨,如果这个工程! – SuperVeetz 2014-10-04 15:16:11
我通过更改了HTML:“text”:emailBody - >“html”:emailBody ...再次感谢! – SuperVeetz 2014-10-05 18:06:45
好凉豆:) – user2488184 2014-10-06 18:50:44