I've created a contact page for a project im working on and im having trouble getting it to send a confirmation email to the user. I have the function defined on my emailer page along with the code that sends the contact form to me
public function sendEmail(){ //this will format and send an email to the smtp server
$to = $this->getSenderEmail();
$subject = $this->getSubject();
$message = $this->getMessage();
$headers = "From: <contact@tristonnearmyer.com >";
$from = $this->getCustomerInfo();
//it will use the php mail()
return mail($to,$subject,$message,$from);
}
public function sendConfEmail(){
$userEmail = $this->getRecipientEmail();
$confSubject = "confirmation";
$confMessage = "thank you";
return mail($userEmail, $confSubject, $confMessage);
}
then the functions are used on the contact page
echo $emailTest->sendEmail(); //send email to SMTP server
echo $emailTest->sendConfEmail(); //send confirmation email
I can't seem to figure out why one is working while the other isn't