Attached doctype email error

I’ve created a custom Doctype in ERPNext and am trying to send it via email with an attach document print option. However, when I attempt to send the email with the attachment, I receive an error in the email queue. On the other hand, emails without any attachments are sent successfully.