//Check if the form is submitted if($_SERVER['REQUEST_METHOD'] == 'POST' && !empty($_POST['requestedItems'])) { $sendmail = new sendRequestClass(); $sendmail->setMail(); $sendmail->setSubject(); $sendmail->setBody($_POST); $sendmail->setMailfrom($_POST['email']); if(!$sendmail->sendMail($sendmail->getMailto(), $sendmail->getSubject(), $sendmail->getBody(), $sendmail->getMailfrom())) { $msg = "

Error

Mail not sent

"; } }