Craft 3 attachment email I need to add an "attachment" to an email sent by Craft CMS 3.

I used a custom "Module" for this with a "Model", "Service", "Record" and "Controller"

I did some research but did not find any clear answers on how to do it.

How to send a email with an attachment?

---- Update -----

Here's what I need to do

Example :

Person A 
Fill the form with file a file ( like doc, pdf etc... )

Prepare the email with the custom "module"

Do I have to upload the file somehow on the server before do the attachement in the email ?

Send the email with the file in attachement to Person B
Assuming what you're trying to attach is on the local filesystem, you can see an example of this here: https://github.com/pixelandtonic/craftnet/blob/master/src/orders/OrderBehavior.php#L160-L182

Essentially, you'd just use attachContent, but there is also an attach method:

-&gt;attachContent($pdf, [
    'fileName' =&gt; $filename,
    'contentType' =&gt; 'application/pdf',
])