<form action="mailto:someone@example.com?subject=Example%20Subject">

mailto: functions as a link to open up a new draft message in the user’s default email client. The value directly after the mailto: syntax is the destination email address; the text after ‘?subject=’ will be the subject line of the draft email. The text ‘%20’ in the subject action will render as a space. We use this code as spaces are not allowed in the query string.

Form method

When creating a form, the method attribute should be completed along with the action attribute. The method simply states how the information in the form should be transferred to the action attribute’s destination address. This can be in one of two ways: GET or POST.

GET method

The GET method, which is the form’s default method, is a way of sending the information via the URL. The information from the form will be appended to the URL, which will then be interpreted by the script at the action attribute’s value. An example of this might be as follows: contactUs.php?firstname=Joe&lastname=Bloggs

In the above example, the script contactUs.php will be passed by two variables.