# Forms: Add subject, CC and BCC

**URL:** <https://discourse.getcockpit.com/t/forms-add-subject-cc-and-bcc/225>\
**Category:** Support\
**Created:** [August 29, 2018, 8:54am UTC](https://discourse.getcockpit.com/t/forms-add-subject-cc-and-bcc/225 "2018-08-29T08:54:17Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![raffaelj](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/raffaelj/32/331_2.png) [@raffaelj](https://discourse.getcockpit.com/u/raffaelj)\
**Post date:** [September 15, 2018, 10:56am UTC](https://discourse.getcockpit.com/t/forms-add-subject-cc-and-bcc/225/3 "2018-09-15T10:56:28Z")

</div>

It’s fixed now. See this thread for more informations: [Forms - What is the best way to pass mailer arguments? - solved](https://discourse.getcockpit.com/t/forms-what-is-the-best-way-to-pass-mailer-arguments-solved/255)

Now you can add this code to `config/bootstrap.php` or to an addon to change your mail settings:

```php
<?php
$app->on('forms.submit.before', function($form, &$data, $frm, &$options) {
    
    // mail subject
    $options['subject'] = 'custom special mail subject';
    
    // add reply_to
    $options['reply_to'] = trim($data['mail']);
    
    // cc and bcc
    $options['cc'] = ['mail1@example.com', 'mail2@example.com'];
    $options['bcc'] = ['mail1@example.com', 'mail2@example.com'];
    
});

```

Have a look at [lib/Mailer](https://github.com/agentejo/cockpit/blob/master/lib/Mailer.php) and [Forms/bootstrap.php](https://github.com/agentejo/cockpit/blob/master/modules/Forms/bootstrap.php#L297) to see more possible options.

Or try

> **[raffaelj/cockpit\_FormValidation](https://github.com/raffaelj/cockpit_FormValidation)**
>
> Form validator and form builder addon for Cockpit CMS - raffaelj/cockpit\_FormValidation

I added a simple templating system for mail subjects and I’ll add more options for CC, BCC etc. soon.

---

_[View the full topic](https://discourse.getcockpit.com/t/forms-add-subject-cc-and-bcc/225)._
