[SalesForce] Attach a file in email from Content builder

Is there anyway that I can attach af file from Content builder in Salesforce marketing cloud?

I want the file to be added to the email like it would do, if you dragged a file into outlook or any other mail clients.

So far I am only able to attach a link to a document which I have uploaded in the Content Builder.

Best Answer

Yes you can, but you have to first ask support to turn it on:

Contact your account representative to have this feature enabled for your account. You must be familiar with AMPscript to send emails with attachments.

Here is the whole description: https://help.salesforce.com/articleView?id=mc_es_email_attachments.htm&type=5

You will need to use this AMPscript function in order to attach a file: AttachFile

Here's a nice example of this function used to attach a file from Content Builder from the ampscript.guide:

%%[

var @customerKey, @fileAlias
set @customerKey = "LoyaltyMembersCB"
set @fileAlias = "LoyaltyMembers_ContentBuilder.zip"

AttachFile("ContentBuilder", @customerKey, @fileAlias)

]%%