Bijgevoegd de code van het formulier :
<!-- Contact Form Overlay
============================================= -->
<div id="contact-form-overlay" class="clearfix">
<div class="fancy-title title-dotted-border">
<h3>Stuur ons een e-mail</h3>
</div>
<div id="contact-form-result" data-notify-type="success" data-notify-msg="<i class=icon-ok-sign></i> Message Sent Successfully!"></div>
<?php
if ( isset( $_POST['submit'] ) )
{
include_once 'lib/swift_required.php';
$to = '[email protected]';
$to_naam = 'Bericht van website';
$from = $_POST['email_from'];
$from_naam = $_POST['naam_from'];
$onderwerp = $_POST['onderwerp'];
$bericht = $_POST['bericht'];
// Create the Mailer using your created Transport
$transport = Swift_MailTransport::newInstance();
$mailer = Swift_Mailer::newInstance($transport);
// Create a message
$message = (
new Swift_Message( $bericht_titel )
)
->setSubject( $onderwerp )
->setFrom( [ $from => $from_naam ] )
->setTo( [ $to => $to_naam ] )
->setBody( $bericht )
;
// Send the message
$numSent = $mailer->send($message);
}
?>
<!-- Contact Form
=============================================-->
<form class="nobottommargin" id="template-contactform" name="template-contactform" method="post" action="">
<!--<input type="hidden" name="action" value="contactForm/sendMessage">
<input type="hidden" name="redirect" value="contact/bedankt">
<input id="omzekertezijn" name="omzekertezijn" type="hidden">-->
<div class="col_full">
<label for="template-contactform-name">Naam <small>*</small></label>
<input type="text" id="template-contactform-name" name="naam_from" value="" class="sm-form-control required" />
</div>
<div class="col_full">
<label for="template-contactform-email">Email <small>*</small></label>
<input type="email" id="template-contactform-email" name="email_from" value="" class="required email sm-form-control" />
</div>
<div class="clear"></div>
<div class="col_full">
<label for="template-contactform-subject">Onderwerp <small>*</small></label>
<input type="text" id="template-contactform-subject" name="onderwerp" value="" class="required sm-form-control" />
</div>
<div class="col_full">
<label for="template-contactform-message">Bericht <small>*</small></label>
<textarea class="required sm-form-control" id="template-contactform-message" name="bericht" rows="6" cols="30"></textarea>
</div>
<div class="col_full hidden">
<input type="text" id="template-contactform-botcheck" name="template-contactform-botcheck" value="" class="sm-form-control" />
</div>
<div class="col_full">
<button class="button button-border nomargin" type="submit" id="template-contactform-submit" name="submit" value="verstuur">Verzenden</button>
</div>
</form>