TYPOlight tutorials
Table of Contents
HACK: Enable CC: in your Contact Forms
If you are using SMTP as your mail sending engine, this hack it not necessary.
CC: Diagnosis: What's the matter dear?
I've setup my website with a contact form using TYPOlight's form generator. The contact form does send an e-mail to the admin recipient, but no matter what I do, the e-mail is NOT copied cc: to the end-user. What's the problem doctor?
CC: Prognosis: Its all a matter of see, see?
You aren't doing any wrong. Its the way TYPOlight uses its plugin for e-mail. Its default is set to use mail, but this program doesn't support CC: fields in the e-mail header. You need to switch to sendmail when you've got a CC:. This can be done using the hack below.
A refresher tutorial on how to ensure you're set-up the Contact form correctly, can be found in the Contact Form Tutorial.
The Hack
This hack will permanently enable CC's for your installation, provided you have php access to the sendmail linux program.
Always create backup files of any TYPOlight core system or plug-in files, if you plan to modify them. That way you can undo the changes easily.
Create a backup of and then edit the following TYPOlight system library file:
- system/libraries/Email.php
Make the following changes:
- search for the string: // Carbon copy
- edit the section to add the line below, marked by the comment added by Thyon Design below:
// Carbon copy
foreach ($this->arrCc as $strRecipient)
{
$objMail->addCC($strRecipient);
$objMail->IsSendmail(); // added by Thyon Design
}
Modifying TYPOlight plugins or other core system files is NOT recommended. When you update your installation, ensure that you re-do this hack, as the installation files will be rewritten, undoing your hack.
What does the Hack do?
This line only changes the default sending program from mail to sendmail when you add any cc: fields in TYPOlight. This is required, because the default mail program cannot handle cc: header fields.
Tutorial created by thyon from thyon design