<h2>Email From the Curious&Creative Website</h2> <p>Name: [[+name]]</p> <p>Email: [[+email]]</p> <p>Phone: [[+phone]]</p> <p>Enquiry: <br />[[+text]]</p>
<form accept-charset="UTF-8" action="https://formkeep.com/f/***" method="POST">
I would test the environment out by writing a little PHP script using the send mail function. this will determine if there is a problem with the environment. it could be the php.ini, or modx doesnt have rights to send email. you need to ensure that there is a valid from email address (an achual mailbox existing on the same domain) also, and ensure that there is a local mail server on your hosting, and that the mail server is of course up and running (this can be tested using telnet to port 25) or 993 if using TLS.
$message = "Sending a Test email to a valid email address. looks like you got it ok"; $modx->getService('mail', 'mail.modPHPMailer'); $modx->mail->set(modMail::MAIL_BODY,$message); $modx->mail->set(modMail::MAIL_FROM,'[email protected]'); $modx->mail->set(modMail::MAIL_FROM_NAME,'CHANGEME'); $modx->mail->set(modMail::MAIL_SUBJECT,'ERROR LOG'); $modx->mail->address('to','[email protected]'); $modx->mail->address('reply-to','[email protected]'); $modx->mail->setHTML(true); if (!$modx->mail->send()) { $modx->log(modX::LOG_LEVEL_ERROR,'An error occurred while trying to send the email: '.$modx->mail->mailer->ErrorInfo); } $modx->mail->reset(); return true;
[[!FormIt? &hooks=`mailcheck` &emailTpl=`mailChunk` &emailTo=`***@curiousandcreative.co.za` &emailFrom=`***@curiousandcreative.co.za` &emailSubject=`WEBSITE ENQUIRY` &redirectTo=`60` &validate=`name:required, email:email:required, text:required:stripTags, nospam:blank` &submitVar=`form-submit` ]]
[[!FormIt? &hooks=`mailcheck` ]]
Hi. Thanks for that.
I gave it a shot - I wasn't sure what you meant when by remove all the hooks, (if just the hooks or clear the whole formit call, so I tried both:
[[!FormIt? &hooks=`mailcheck` &emailTpl=`mailChunk` &emailTo=`***@curiousandcreative.co.za` &emailFrom=`***@curiousandcreative.co.za` &emailSubject=`WEBSITE ENQUIRY` &redirectTo=`60` &validate=`name:required, email:email:required, text:required:stripTags, nospam:blank` &submitVar=`form-submit` ]]
and
[[!FormIt? &hooks=`mailcheck` ]]
Both had the same result - nothing, and my error log is still empty :/
<form accept-charset="UTF-8" action="sendform.php" method="POST"> <div class="form-group"> <input type="text" class="form-control mt24"name="first_name" id="first_name" placeholder="NAME"> <input type="text" class="form-control mt24"name="email" id="email" placeholder="EMAIL" > <input type="text" class="form-control mt24"name="telephone" id="telephone" placeholder="CONTACT NUMBER"> <textarea name="comments" id="comments" placeholder="MESSAGE" class="form-control mt16"></textarea> <button type="submit" class="btn btn-default mt16 pull-left">SUBMIT</button> </div> </form>