I wanted to have a contact page that would allow someone to contact the author or some other responsible person, so I created this contact page. I used the usermanager plugin and the discussion plugin as help in creating this.
Download the plugin here: Contact Form Plugin
{{contact>}}
This will create a form with a “name”,”from address”, “subject”, and “comment” field. It will send an email to whatever the default value is. You can also specify the ‘to’ or ‘subj’ parameters:
{{contact>to=profile1}}
or
{{contact>subj=Feedback from Site}}
or join them with a | character:
{{contact>to=profile1|subj=Feedback from Site}}
When the subject is specified in the parameters, it is not a field on the contact form. The plugin will only send email to one destination.
It’s that easy!
Basically, it uses the same mail function that the rest of the wiki uses, so it requires no extra server configuration (although you do have to edit your configuration settings to specify at least a default to address). When the form is submitted, it will post back to the same page, but set a variable so it knows to send an email. It will send an email TO the address specified and FROM that same address (so that it doesn’t fail if the user enters a strange email address). I have taken some steps to make sure that it isn’t vulnerable to some of the more common attacks, so it shouldn’t be possible to use maliciously.