# I cannot set Message-ID and add multiple PDF with loop

**URL:** <https://discourse.laminas.dev/t/i-cannot-set-message-id-and-add-multiple-pdf-with-loop/1504>\
**Category:** Components & MVC\
**Created:** [April 5, 2020, 2:29am UTC](https://discourse.laminas.dev/t/i-cannot-set-message-id-and-add-multiple-pdf-with-loop/1504 "2020-04-05T02:29:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yunluo989](https://avatars.discourse-cdn.com/v4/letter/y/278dde/32.png) [@yunluo989](https://discourse.laminas.dev/u/yunluo989)\
**Post date:** [April 5, 2020, 2:29am UTC](https://discourse.laminas.dev/t/i-cannot-set-message-id-and-add-multiple-pdf-with-loop/1504/1 "2020-04-05T02:29:30Z")

</div>

i have tried to set message-id with this code

```
use Laminas\Mail\Message;
use Laminas\Mime\Message as MimeMessage;
$message = new Message();

$message->getHeaders()->clearHeaders();

```

$message-\>getHeaders()-\>addHeaderLine(‘Message-ID’, ‘[generate.random@mydomain.com](mailto:generate.random@mydomain.com)’);

and i got this message raw from my email  
Message-ID: [5e88a6d1.1c69fb81.2faa8.789fSMTPIN\_ADDED\_BROKEN@mx.google.com](mailto:5e88a6d1.1c69fb81.2faa8.789fSMTPIN_ADDED_BROKEN@mx.google.com)

also how to set encoding to letter body without make it to setPart of MIME ?  
and i cannot add multiple PDF attachments with loop

sorry my english seems like bad
