I have problems when sending email, I make registration and verification by email, when on localhost everything runs smoothly, there are no problems, but when I am hosting, the email function cannot, please help

```
 $config = array(
        'protocol'  => 'smtp',
        'smtp_host' => 'ssl://smtp.gmail.com',
        'smtp_port' =>  465,
        'smtp_user' => 'email@gmail.com', // change it to yours
        'smtp_pass' => 'mypassword', // change it to yours
        'mailtype'  => 'html',
        'charset'   => 'iso-8859-1',
        'wordwrap'  =>  TRUE
        );
    $message =  "
    <html>
    <head>
    <title>Verifikasi Kode</title>
    </head>
    <body>
    <h2>Terima kasih telah berpartisipasi.</h2>
    <p>Akun anda:</p>
    <p>Email: ".$email."</p>
    <p>Untuk melanjutkan pendaftaran, mohon klik link yang kami berikan</p>
    <h4><a href='".base_url()."register/aktivasi/".$id."'>Activate My Account</a></h4>
    </body>
    </html>
    ";
    $this->email->initialize($config);
    $this->load->library('email', $config);
    $this->email->set_newline("\r\n");
    $this->email->from($config['smtp_user']);
    $this->email->to($email);
    $this->email->subject('Signup Verification Email, abcd.com | No reply');
    $this->email->message($message);
    if($this->email->send()){
        $this->session->set_flashdata('msg','Kode Aktivasi telah dikirim ke email, mohon di cek');
    }
    else{
        $this->session->set_flashdata('msg', $this->email->print_debugger());
    }

    redirect('register',$data);
}

```

> 
> Error : Failed to authenticate password. Error: 534-5.7.14 Please 534-5.7.14 log in via your web browser and then try again. 534-5.7.14 Learn more at 534 5.7.14 <https://support.google.com/mail/answer/78754> 18sm13749594pfp.100 - gsmtp
> 
> 
> Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.
> 
> 
>
['https://Stackoverflow.com/questions/58267243', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/11944485/']
**Tl;dr:**

> 
> You'll see this occur in most templates in the Template Gallery. The
> official [Google Documentation](https://developers.google.com/tag-platform/tag-manager/templates/api#createqueue) has nothing to say about it.
> However, in my tests, this small change in structure (nesting your
> pushes in randomly-named sub-objects) does not affect GTM's ability to
> pick up on the event names. So you should be able to use them as they
> are.
> 
> 
> 

**Detailed response**

Even though you see nesting within the dataLayer object, this doesn't translate to nesting within GTM's data model.

To test this, consider the following setup:

1. A custom HTML tag that pushes a nested object to the dataLayer

```html
<script>
  var dataLayer = window.dataLayer || [];
  dataLayer.push({lv:{bl:{event:'test'}}});
</script>
```

2. A Tag Template that pushes a simple event to the dataLayer

```js
const dataLayerPush = require('createQueue')('dataLayer');
dataLayerPush({event:'test'});
data.gtmOnSuccess();
```

These 2, when fired, will produce seemingly identical results. Check the linked image for details.
[Test Events pushed by the Tag Template (1) and Custom HTML Tag (2)](https://i.stack.imgur.com/QP3Np.png)

However, if you set up a Custom Event Trigger that listens for `'test'` event names, only the one created by the Tag Template will fire. You can also see that the one created by the Tag Template also has a `gtm.uniqueEventId` key-value pair. The objects are not the same, and they are not treated the same way.

You can try to debug further by using the [dataLayer helper](https://github.com/google/data-layer-helper), if that's doable for you.

Hope this helps the next person to stumble upon this. I know I needed it.
For a dataLayer push you can use a custom
HTML template and trigger it via page view then add the below code

```
<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'event': 'test_push'
 });
</script>

```