Set the attachments for the message.

@param  mixed  $attachments
@return $this
177287
public function setAttachments($attachments)
    {
        $this->removeAttachments();

        if (is_array($attachments)) {
            foreach ($attachments as $attachment) {
                $this->addAttachment($attachment);
            }
        }

        return $this;
    }
306496
public function setDeclarations($declarations)
    {
        $this->declarations = [];
        if (!is_array($declarations)) {
            $declarations = [$declarations];
        }
        foreach ($declarations as $declaration) {
            $this->addDeclaration($declaration);
        }

        return $this;
    }
691225
protected function setDestination(array $mails)
    {
        $this->recievers = $mails;

        $this->message->setTo($this->recievers);

        return $this;
    }
1336276
public function setRecipients($recipients)
    {
        // idiot proof patch
        if (is_string($recipients)) {
            $recipients = [$recipients];
        }

        if (!is_array($recipients)) {
            throw new \LogicException('$recipients parameter is expected to be an array or a string');
        }

        $this->initAddress($recipients, 'recipients');

        return $this;
    }
687412
public function validateAttachments(array $attachments)
    {
        $success = true;
        foreach ($attachments as $attachment) {
            if (!isset($attachment['filename']) || empty($attachment['filename'])) {
                $this->addError('attachments', 'Attachment must have a filename');
                $success = false;
            }

            if (!isset($attachment['mime_type']) || empty($attachment['mime_type'])) {
                $this->addError('attachments', 'Attachment must have a MIME type');
                $success = false;
            }

            if (!isset($attachment['contents'])) {
                $this->addError('attachments', 'Attachment must have contents');
                $success = false;
            }
        }

        return $success;
    }
466191
public function addAttachment($attachment): Letter
    {
        if (!is_file($attachment)) {
            throw new InvalidArgumentException('"%s" can not be found or is not a file');
        }

        $this->attachments[] = $attachment;

        return $this;
    }
492710
public function setSenders($senders)
    {
        $this->senders = [];
        if (count($senders)) {
            foreach ($senders as $channel => $sender) {
                $this->addSender($channel, $sender);
            }
        }

        return $this;
    }
1365480
public function attach($attachment)
    {

        if (is_string($attachment)) {
            $attachment = new SwiftAttachment($attachment);
        }

        if ($attachment instanceof SwiftAttachmentInterface) {
            $attachment = $attachment->getAttach();
        }

        $this->message->attach($attachment);
        return $this;

    }
423742
public function setTo(array $addresses): Email
    {
        $addresses = $this->transformAddressesToArray($addresses);
        $this->message->setTo($addresses);

        return $this;
    }
493527
protected function buildAttachments($message)
    {
        foreach ($this->attachments as $attachment) {
            $message->attach($attachment['file'], $attachment['options']);
        }

        foreach ($this->rawAttachments as $attachment) {
            $message->attachData(
                $attachment['data'], $attachment['name'], $attachment['options']
            );
        }

        $this->buildDiskAttachments($message);

        return $this;
    }
792813
protected  function processSomeAttachments($models, $attachments)
	{
		foreach ($models as $model) 
		{
			foreach ($model->getAttachedFiles() as $attachedFile) 
			{
				if (in_array($attachedFile->name, $attachments)) {
					$attachedFile->reprocess();
				}
			}
		}
	}
660454
public function setBindings(array $bindings)
    {
        foreach ($bindings as $key => $binding) {
            if (0 < strpos($key, '$') && $key !== $k = preg_replace('/[ \t]*\$/', ' $', $key)) {
                unset($bindings[$key]);
                $bindings[$key = $k] = $binding;
            }
            if (!$binding instanceof BoundArgument) {
                $bindings[$key] = new BoundArgument($binding);
            }
        }

        $this->bindings = $bindings;

        return $this;
    }
725614
public AbstractSheet<TRow, TColumn, TCell> setAttachments(List<Attachment> attachments) {
        this.attachments = attachments;
        return this;
    }
917430
public function saveAttachments($mail)
    {
        /** @var \Shockwavemk\Mail\Base\Model\Mail\Attachment[] $attachments */
        $attachments = $mail->getAttachments();

        foreach ($attachments as $attachment) {
            $this->saveAttachment($attachment);
        }

        return $this;
    }
1183928
public function setAttachments($attachments): self
    {
        if (!is_iterable($attachments)) {
            throw new Exception(sprintf('%s() expects argument passed to be iterable, %s given', __METHOD__, gettype($attachments)));
        }

        $this->attachments = [];
        foreach ($attachments as $attachment) {
            $this->addAttachment($attachment);
        }

        return $this;
    }
294909
private function prepareAttachments($attachments = null)
    {
        $file_params = [];

        if ($attachments) {
            $counter = 1;

            foreach ($attachments as $attachment) {
                $path = is_array($attachment) ? $attachment[0] : $attachment;

                if (is_readable($path)) {
                    $file_params['attachment_'.$counter++] = $attachment;
                } else {
                    throw new FileNotReadable($attachment);
                }
            }
        }

        return $file_params;
    }
461679
public function setMessages(array $messages)
    {
        return tap($this, function ($instance) use ($messages) {
            $instance->messages = [$instance->messagesWrapper => $messages];
        });
    }