Error when adding ['title'] field to an email message subject of contact form

2 posts by 2 authors in: Forums > CMS Builder
Last Post: July 28, 2015   (RSS)

By Mikey - July 21, 2015

I'm trying to add the ['title'] field to an email message subject when some submits a form related to a specific page that the ['title'] field exist on.

However it's throwing the follow error message in bold below.

Error sending email: mail(): Bad parameters to mail() function, mail not sent.

Anyone have any suggestions on how to get this to work? Below is the code I'm using.

if (!$errorsAlerts) {
        $from        = $_REQUEST['sendto'];
$headers    = 'MIME-Version: 1.0' . "\r\n";
        $headers    .= 'Content-type: text/html; charset=utf-8' . "\r\n";
        $headers    .="From: $from \r\n";
        $to          = "zick@example.com";
        $subject     = "{$_REQUEST['firstname']} {$_REQUEST['lastname']} is interested in {$productRecord['title']}, Item Number {$productRecord['item_number']} submitted a message at {$_SERVER['HTTP_HOST']}";
        $message     = <<<__TEXT__

Thanks, Zick