X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=metaform%2Ftemplate.php;h=af98d9623bf9530d399ce4d94f434011edcc0608;hb=a4e42e7c89f4c256ff2512902fb539a2279785ce;hp=5a5c0eeb00bd0fea4feae02f9ecf679fd793d711;hpb=38773f50c9e89f547d2e190d2ae64a5fc39a038d;p=wfpl.git diff --git a/metaform/template.php b/metaform/template.php index 5a5c0ee..af98d96 100644 --- a/metaform/template.php +++ b/metaform/template.php @@ -86,12 +86,18 @@ function ~form_name~() { $message = tem_run('~form_name~.email.txt'); $cc = ''; $bcc = ''; - email($from, $to, $subject, $message, $cc, $bcc); + if(email($from, $to, $subject, $message, $cc, $bcc)) { + tem_set('error_message', 'Due to an internal error, your message could not be sent. Please try again later.'); + tem_sub('error'); + $error = true; + } + } + if($error !== true) { + tem_load('~form_name~.html'); + tem_sub('thankyou'); + tem_output(); + exit(); } - tem_load('~form_name~.html'); - tem_sub('thankyou'); - tem_output(); - exit(); } # otherwise, we display the form again. ~form_name~_get_fields() has # already put the posted values back into the template engine, so they will