Email Contact Form
The purpose of this tag is to create a contact form on one of your pages that your users can use to send you email.
For full documentation of available parameters please see the ExpressionEngine Documentation.
- Native
- Twig
- Blade
{exp:email:contact_form user_recipients="no" recipients="admin@example.com" charset="utf-8"}
<h2>Support Form</h2>
<p>
<label for="from">Your Email:</label><br />
<input type="text" id="from" name="from" size="40" maxlength="35" value="{member_email}" />
</p>
<p>
<label for="subject">Subject:</label><br />
<input type="text" id="subject" name="subject" size="40" value="Contact Form" />
</p>
<p>
<label for="message">Message:</label><br />
<textarea id="message" name="message" rows="18" cols="40">
Support Email from: {member_name}
Sent at: {current_time format="%Y %m %d"}
</textarea>
</p>
<p>
<input name="submit" type='submit' value='Submit Form' />
</p>
{/exp:email:contact_form}
{% set form = exp.email.contact_form({
user_recipients: 'no',
recipients: 'admin@example.com',
charset: 'utf-8'
}) %}
{{ form.open() | raw }}
<h2>Support Form</h2>
<p>
<label for="from">Your Email:</label><br/>
<input type="text" id="from" name="from" size="40" maxlength="35" value="{{ form.member_email }}"/>
</p>
<p>
<label for="subject">Subject:</label><br/>
<input type="text" id="subject" name="subject" size="40" value="Contact Form"/>
</p>
<p>
<label for="message">Message:</label><br/>
<textarea id="message" name="message" rows="18" cols="40">
Support Email from: {{ form.member_name }}
Sent at: {{ form.current_time.format("Y-m-d") }}
</textarea>
</p>
<p>
<input name="submit" type='submit' value='Submit Form'/>
</p>
{{ form.close() | raw }}
@php
$form = $exp->email->contact_form({
user_recipients: 'no',
recipients: 'admin@example.com',
charset: 'utf-8'
})
@endphp
{!! $form->open() !!}
<h2>Support Form</h2>
<p>
<label for="from">Your Email:</label><br/>
<input type="text" id="from" name="from" size="40" maxlength="35" value="{{ $form->member_email }}"/>
</p>
<p>
<label for="subject">Subject:</label><br/>
<input type="text" id="subject" name="subject" size="40" value="Contact Form"/>
</p>
<p>
<label for="message">Message:</label><br/>
<textarea id="message" name="message" rows="18" cols="40">
Support Email from: {{ $form->member_name }}
Sent at: {{ $form->current_time->format("Y-m-d") }}
</textarea>
</p>
<p>
<input name="submit" type='submit' value='Submit Form'/>
</p>
{!! $form->close() !!}