【发布时间】:2020-11-06 21:37:20
【问题描述】:
(免责声明:我对 HTML/CSS/JavaScript 很陌生,如果我的代码有问题,请见谅)
我正在寻找一种方法来生成带有电子邮件附件的电子邮件。这是我的代码:
<body>
<form action="mailto:example3@example.com" method="GET">
<label for="cc">Cc Line Addresses:</label>
<br>
<input id="cc" name="cc" type="email multiple" value="example1@example.com;example2@example.com"/>
<br>
<br>
<label for="subject" >Enter your subject below:</label>
<br>
<input type="text" name="subject" id="subject">
<br>
<br>
<label for="body" >Enter the Email Body below:</label>
<br><textarea id="body" name="body" rows="5" cols="50">Example body</textarea>
<br>
<br>
<label for= "myFile">Click below to upload your attachment file</label>
<!-- This is where I want the attachment to flow to the email-->
<br>
<br>
<input type="file" id="myFile" name="attachment" class="fileUpload">
<br>
<br>
<strong><label for="submit">Click Below to Generate New Email</label></strong>
<br>
<input type="submit" id="submit" value="Generate">
</form>
</body>
我想使用 Javascript 将 HTML 表单中上传的文件附加到提交按钮生成的电子邮件(使用默认电子邮件客户端打开)。
谢谢!
【问题讨论】:
-
请注意,目标电子邮件地址不会对用户隐藏,因此可用于发送垃圾邮件或其他虚假邮件。所以不要使用个性化的电子邮件地址,使用更通用的地址,例如 feedback@example.org。
标签: javascript forms html-email email-attachments