如何从HTML发送电子邮件...................................... [英] How to send e-mail from HTML.............................
问题描述
您好,先生,请给我代码
hoe从html发送电子邮件
我的领域
名称-
消息-
[更新]
您好先生,没有Outlook,请不要使用Outlook
如果您不想打开Outlook,请使用send mail或使用以下命令.
hello sir give me code
hoe to send email from html
my field
name--
message--
[UPDATE]
Hello sir not use outlook without outlook
use send mail or use following if you don''t want to open outlook
推荐答案
请使用
<a href="mailto:email?subject=sub&body=msg">send mail </a>
;如果您不想打开Outlook,请使用以下命令
or use following if you don''t want to open outlook
<html>
<head>
<title> New Document </title>
</head>
<html>
<body>
<form action="MAILTO:pankajupadhyay29@gmail.com" method="post" enctype="text/plain">
<h3>This form sends an e-mail to pankajupadhyay29@gmail.com.</h3>
Name:<br>
<input type="text" name="name">
value="Name size="20">
<br>
Mail:<br>
<input type="text" name="mail">
value="Mail id" size="20">
<br>
Comment:<br>
<textarea>
</textarea>
</br><br>
<input type="submit" value="Send">
<input type="reset" value="Reset">
</input></input></br></br></input></br></br></input></br></form>
</body>
</html>
</html>
此代码取自此处 [
this code is taken from here[^]
此 ^ ]可能有助于实现SAKryukov的建议.
问候
Espen Harlinn
This ASP.NET Common Web Page Class Library - Part 3[^] may help to implement SAKryukovs suggestion.
Regards
Espen Harlinn
顺便说一句,您不能通过HTML发送电子邮件".
使用HTML,您可以执行以下操作来创建一个表单,该表单用于通过POST命令将请求发布到HTTP服务器.服务器可以通过任何方式(例如发送电子邮件)来处理此帖子.为此,您不必编写HTTP服务器:)-有许多不同的服务器端模块可让您编写服务器端脚本:APS.NET,通过WSGI编写的Python,Java Server Pages,PHP…
在HTML方面,关键是在表单上使用right属性:
By the way, you cannot "send e-mail" from HTML.
With HTML, what you can do it to create a form used to post request to your HTTP server via POST command. It''s up to your server to process this post in any way such as sending e-mail. You don''t have to write HTTP server for this purpose :) — there are different server-side modules which allows you to write a server-side script: APS.NET, Python via WSGI, Java Server Pages, PHP…
On HTML side, the key is using right attribute on the form:
<form action="My-Email-sender-URL" method="post" ...>
...
</form>
安全警告!使用类似的帖子在服务器端发送电子邮件是容易受到恶意攻击的目标,它可以使HTTP服务器变成垃圾邮件发送的幽灵,因为该帖子可以通过编程方式完成.您不应直接使用任何已发布的数据,尤其是对于电子邮件标题.您需要检测并过滤出意外数据. (我不得不修复此类安全漏洞,并在现实生活中面临此类攻击.)
Security warning! Using posts like that for sending e-mail on the server side is an easy target for malicious attack which can turn you HTTP server into the spam-sending ghost as the post can be done programmatically. You should not use any posted data directly, especially for e-mail headers. You need to detect and filter out unexpected data. (I had to fix such security holes and faced such attacks in real life.)
这篇关于如何从HTML发送电子邮件......................................的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!