Question: There is a containment `OneToOne` relationship `Library -- Boss`:

```
Library --(Cascade)--> Boss
Boss    --(No Action)--> Library

```

Use case: replace boss. Replace means remove old value from database, save new value in database and set new value of the relationship. If I set a new boss and save the context, new boss is inserted, relationship is set to the new boss, but the old boss is not removed, it only gets library key nullified. How would I remove old boss complete from database?

Answer: 
Instead of

```
mail($emailTo, $subject, $body, $headers);

    // set our boolean completion value to TRUE
    $emailSent = true;

```

do

`$emailSent = mail($emailTo, $subject, $body, $headers);`

otherwise you'll be hardcoding the result, why would you say that the email has been sent if you don't know? what are you, some kind of liar?
Ensure that your php mail smtp headers is properly configured. 
below are sample code which works for me. Copy and try it.

 If the code below does not work for you then try to install Dropifi Contact Widget
(www.dropifi.com). They have a very intuitive contact form which you can customize to meet your need.

```
require_once("class.phpmailer.php");
require_once("class.smtp.php");

  class Email extends PHPMailer
  {       
      public function __construct(){
          parent::__construct(true);
          $this->IsSMTP();
          $this->SMTPAuth = true;
          $this->SMTPSecure = "ssl";
          $this->Host = "smtp.gmail.com";
          $this->Port = 465;
          $this->Username = "someemail@gmail.com";
          $this->Password = "your password";
          $this->from = "no-reply@localhost.com";
          $this->FromName = "Webmaster";
          $this->WordWrap = 50;
          $this->IsHTML(true);
          $this->AddReplyTo("no-reply@localhost.com", "Webmaster");
          $this->Mailer = "smtp";
      }

      public function setReceiver($to){ 
          $this->AddAddress($to,"Administrator");
      }

      public function setSubject($subject){ 
          $this->Subject = $subject;
      }

      public function setMessage($param){

          $this->AltBody = "your alternative message";

          $message = "your main  message";
          $this->MsgHTML($message);
      }

      public function sendmail(){
          try{
              $flag = $this->Send();
              return $flag;
          }catch(phpmailerException $e){
              return $e->getMessage(); 
          }
      }
  }                             

```