Here is how:
Login to Gmail and click the add-ons icon + from the sidebar.
Then from the available list of add-ons for Gmail, choose Dropbox. This is the official Dropbox add-on for Gmail.
Once the add-on is installed, choose DONE.
Dropbox icon will now be visible in the Gmail sidebar as well as when composing messages.
To select a file or folder to be added as a Gmail attachment, click the Dropbox icon. Then sign in using Dropbox credentials and allow app access.
Initially, if you are signed into more than one Gmail account from the same browser, you would need to logout and use the one that requires Dropbox attachments.
Once the sign is successful, the list of files and folders from your Dropbox account will now be visible.
To insert folders as Gmail attachments, choose INSERT LINK. For individual files, use the + icon.
These folders and files will now be sent as Dropbox links that can be directly opened and viewed by recipients.