Tell me, please, how to write htmi code so that the forms on the site receive the contents of these forms on my e-mail. Thank you in advance.

    2 answers 2

    it's in index.php

    // уведомление на емаил include_once ('include/mail.php'); $mail = new mail; $mail->send_comment(CONFIG_E_MAIL, LANG_SEND_MAIL_COMMENT_SUBJECT, $user_value, $email_value, $text_value); 

    mail.php file

     class mail { public function send_comment($from, $subject, $user, $email, $text) { $message = '<html>'."\n"; $message .='<head>'."\n"; $message .='<title>mJournal - '.$subject.' '.$_SERVER['HTTP_HOST'].'</title>'."\n"; $message .='<style type="text/css">'."\n"; $message .='body { background-color: #000000; color: #FFFFFF; margin: 10px; padding: 0px; }'."\n"; $message .='h1 { font-size: 18px; margin: 5px; padding: 0px; }'."\n"; $message .='p { font-size: 12px; margin: 5px; padding: 0px; }'."\n"; $message .='</style>'."\n"; $message .='</head>'."\n"; $message .='<body>'."\n"; $message .='<h1>'.$subject.' '.$_SERVER['HTTP_HOST'].'</h1>'."\n"; $message .='<p><b>'.LANG_USER.':</b> '.$user.'<br>'."\n"; $message .='<b>'.LANG_EMAIL.':</b> '.$email.'<br>'."\n"; $message .='<b>'.LANG_MESSAGE.':</b><br>'.$text.'</p>'."\n"; $message .='<p>------------------------------<br>mJournal</p>'."\n"; $message .='</body>'."\n"; $message .='</html>'; $headers = "From: ".$from."\r\n" . "X-Mailer: PHP/" . phpversion() . "\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: text/html; name=\"mJournal.html\" charset=utf-8\r\n" . "Content-Transfer-Encoding: 8bit\r\n\r\n"; mail($email, $subject, $message, $headers); } } 

      No Write a form handler using the mail () function.