<?php

//Declare Variables
$name = $jobtitle = $company= $email = $phone_number = $msg_subject = $message = '';


$name = $_POST['name'];
$company = $_POST['company'];
$jobtitle = $_POST['jobtitle'];
$email = $_POST['email'];
$phone_number = $_POST['phone_number'];
$msg_subject = $_POST['msg_subject'];
$message = $_POST['msg']; 

if ($name !=='' && $jobtitle !=='' && $company !=='' && $email !=='' && $phone_number !=='' && $msg_subject!=='' && $messsage !=='' ){

      $from = "From: COSM Website Strategy & Culture Page!"; //Site name
      // Change this to your email address you want to form sent to
      $to = "info@co-sm.co"; 
      $subject = "Enquiry from " . $name . " for COSM ";
      $message = "Following are the details: 
      \n
      Name: $name
      Company:$company
      Job Title: $jobtitle
      Email:$email
      Message Subject: $msg_subject
      Phone Number: $phone_number
      Message: $message
      ";
      if ( mail($to,$subject,$message,$from)){
        echo 'success';   
    }
    }


?>