我想用html发送带附件的电子邮件,我可以这样做(因为我没有服务器只是静态的)?
我想上传文件并通过电子邮件发送它不存储它,下面的代码将文件存储在磁盘上是否可以通过邮件发送?
<form action="fileinsert.html" method="post"> <p> Enter Your Text :<br> <input type="text" name="textwrite" size="15"> </p> <p> Specify your File:<br> <input type="file" name="datasize" size="30"> </p> <div> <input type="submit" value="Send"> </div> </form>这只是html的可行吗?
I want to send an e-mail with attachment using just html ,can I do that(because I dont have a server just static)?
I want to upload the file and e-mail it not store it, the code below store the file on disk is it possible to send it via mail?
<form action="fileinsert.html" method="post"> <p> Enter Your Text :<br> <input type="text" name="textwrite" size="15"> </p> <p> Specify your File:<br> <input type="file" name="datasize" size="30"> </p> <div> <input type="submit" value="Send"> </div> </form>is this doable with just html?
最满意答案
不,你不能用纯HTML做到这一点。
要发送电子邮件,您需要在服务器上使用PHP脚本,该脚本从表单中收集数据并发送:
<?php mail($_POST['to'], $ubject, $message); ?>这只是如何使用邮件功能而不是功能代码片段的一个小例子,有关详细信息,请参阅mail()函数
你也应该看一下Mail_Mime 。
正如Chris Peter所说,有多种方法可以做到:你可以使用Ruby,Perl,Python,.NET甚至C来完成这项任务。
No, you can't do this with pure HTML.
To send E-Mails you need a PHP-Script on the server which collects the data from your form and send it:
<?php mail($_POST['to'], $ubject, $message); ?>This is just a little example of how using the mail-function and not a functional snippet for your problem, see for more information see mail() function
You also should have a look at Mail_Mime.
As Chris Peter says there is more than one way to do it: You can use Ruby, Perl, Python, .NET and even C for accomplishing this task.
更多推荐
发布评论