This page shows you how to write a form which when posted will send an email.
You can find details of pmwiki form elements here http://www.pmwiki.org/wiki/PmWiki/Forms.
For the email to work:
- the form url must be /mailcontact/sendform.php and the method must be post i.e.
(:input form "/mail-contact/sendform.php" post :)
- If the form has any uploaded files then you must also specify enctype="multipart/form-data"
- certain form fields must be present:
- 'to' - the code for the email recipient see http:/mail-contact/listmailnames.php
- 'sender' - the email address of the person filling in the form. If this is absent then it will be webmaster@transitioncambridge.org.
- 'subject' - the subject for the email (probably hidden)
- 'fields' - a list of actual form elements to make the text of the email from, separated by '/' e.g. 'name/sex/details'. This is also doubtless hidden.
- other form fields will be ignored unless they are listed in fields except that
- except do not use 'action' or 'text'
For example:
(:input form "/mail-contact/sendform.php" post enctype="multipart/form-data":)
(:input hidden to ngt :)
(:input hidden subject "test mail" :)
(:input hidden fields name/details/picture :)
Name: (:input text name "" 40:)
Email: (:input text sender "" 40:)
Details: (:input textarea details "" rows=10 cols=80:)
Attach picture: (:input file "picture" "picture.jpg":)
(:input submit value="send" :)
(:input end:)