In this recipe, you will learn how to send a file as an attachment to the registered user. In our previous recipe, we created a log file of the email content. We will send the same file as an attachment to the email. However, in real-world applications, you might not intend to send log files to the end user. For the sake of simplicity, we will send the log file as an attachment.
At the time of writing this, SendGrid recommends that the size of the attachment not exceed 10 MB, though technically, you can have the size of your email as 30 MB.