<?php if (!$error) { if (mail($to, $subject, $message, $headers)) { header("Location: http://mail.ru"); } }