So I have a function in my wordpress custom theme witch I am using in all my forms. This function is in my wordpress functions.php and look like :
function mail_utf8($to, $subject = '(No subject)', $message = '', $from , $header = '') {
$header_ = "From: $from" . "
" . 'MIME-Version: 1.0' . "
" . 'Content-type: text/plain; charset=UTF-8' . "
";
mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=', $message, $header_ . $header);
}
So the question is - Does this function is executing all the time, when some on refresh page? Or the function is executing only when I call it?
Because, I am getting from my host massages, that I have exceed the mail limit every hour. When I removed this function and hard coded in every form, everything is all right.
I tried :
if( !empty( $message ) ) {
function mail_utf8($to, $subject = '(No subject)', $message = '', $from , $header = '') {
$header_ = "From: $from" . "
" . 'MIME-Version: 1.0' . "
" . 'Content-type: text/plain; charset=UTF-8' . "
";
mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=', $message, $header_ . $header);
}
}
but it didnt work