I want an HTML form to send email.
Waiting for ur replies.
I dont know AJAX,Jquery etc. I know Java(jsp,servlet),html,javascript.
Simple answer for pure HTML: you can't.
When you don't want to send emails like so <a href="mailto:xyz@abc.com">Send Mail</a>
, which would open the user's email client to send it manually. You will need an php server in the back which is able to send emails.
If you want to do it with JSP
This tutorial also provides file upload, or better for you it provides finished code:
HTML forms don't do much other than, when submitted, send the inputs they contain back to the server in the for of an HTTP POST.
In order to display the checkboxes in response to the select input (dropdown list) changing you've got two options:
Once the form contains the inputs required to send the mail it can be submitted, resulting in an HTTP POST at the server. You'll need to read the input values and send the mail using JavaMail .
With regards to the attachment, you need to first get the uploaded file ( Apache Commons can help you there) then attach the file to the mail as explained here .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.