如何从html发送邮件 [英] how to send mail from html

查看:78
本文介绍了如何从html发送邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个单独的HTML(如何编写从前端发送电子邮件的代码(html自身)。

i have a single html( how to code for sending email from front-end(html from itself).

<textarea class="textarea" placeholder="*Tell us more about your project here ..." id="contact_message"></textarea>
        <input type="text" class="textinput" placeholder="*Full Name" id="contact_fullname"/>
        <input type="email" class="textinput" placeholder="*Email Address" id="contact_email"/>
        <input type="text" class="textinput" placeholder="Phone Number" id="contact_phone"/>
        <input type="button" class="submit_button" value="Send Message" onclick="submit_contacts();"/>







帮助我如何在html中发送电子邮件的代码..




help me how to code for send email in html ..

推荐答案

HTML无法发送邮件或任何其他活动行为。您所能做的就是使用锚点,但它不发送电子邮件,它只是帮助用户启动能够发送邮件的默认邮件客户端,以及填写一些数据。



URI 方案是mailto;这里用例子解释: http://en.wikipedia.org/wiki/Mailto



如您所见,您可以在邮件客户端填写一些可选字段:地址,主题和正文。也就是说,这个功能非常有限。真正可以发送邮件的其他技术基于服务器端编程。



如果必须根据某些数据动态形成此URI,则可以计算URI字符串并使用JavaScript将其设置为HTML的DOM。如果你知道JavaScript,那就太微不足道了,如果你不知道,快速回答几乎不是解释JavaScript和DOM操作的好地方。因此,如果您的JavaScript知识处于中间位置并且您想要解决此类问题,请随时就您可能存在的问题提出一些更具体的问题。



再次, HTML不发送电子邮件。



-SA
HTML is not capable of sending mail or any other "active" behaviors. All you can do is to use an anchor, but it does not send e-mail, it just helps the user to start the default mail client capable of sending mail, and to fill in some of the data.

The URI scheme is "mailto"; it is explained here with examples: http://en.wikipedia.org/wiki/Mailto.

As you can see, you can fill in some optional fields in the mail client: address, subject and body. That said, this functionality is very limited. Other techniques which really can send mail are based on server-side programming.

If you have to form this URI dynamically based on some data, you can calculate the URI string and set it to the DOM of your HTML using JavaScript. If you know JavaScript, it's way too trivial, if you don't, a Quick Answer hardly can be a good place to explain all about JavaScript and DOM manipulations. So, if your JavaScript knowledge is somewhere in the middle and you want to solve such problem, feel free to ask some more specific questions on your possible concerns.

Again, HTML does not send e-mail.

—SA


这篇关于如何从html发送邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆