Which of these protocols are used to send the attachements in emails?
To embed an attachment into an email we usually use Multipurpose Internet Mail Extensions (MIME) described in RFC 2045.
Basically, to send an attachment we divide our email into parts, so the first part is the text and the next part(s) is an attachment(s) or vice versa.
To see the original email structure, we can click "Show original" on an email with attachment(s). The result will be like follows:
From: Whomever
To: Someone
Date: Whenever
Subject: whatever
MIME-Version: 1.0
Message-ID: <id1@host.com>
Content-Type: multipart/alternative; boundary=42
Content-ID: <id001@guppylake.bellcore.com>
--42
Content-Type: message/external-body; name="BodyFormats.ps";
site="thumper.bellcore.com"; mode="image";
access-type=ANON-FTP; directory="pub";
expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)"
Content-type: application/postscript
Content-ID: <id42@guppylake.bellcore.com>
--42
Content-Type: message/external-body; access-type=local-file;
name="/u/nsb/writing/rfcs/RFC-MIME.ps";
site="thumper.bellcore.com";
expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)"
Content-type: application/postscript
Content-ID: <id42@guppylake.bellcore.com>
--42
Content-Type: message/external-body;
access-type=mail-server
server="listserv@bogus.bitnet";
expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)"
Content-type: application/postscript
Content-ID: <id42@guppylake.bellcore.com>
get RFC-MIME.DOC
--42--
This is an example from the RFC 2046. That is how we embed an attachment to the message.
To send a message with attachment(s), we use SMTP. IMAP can be used to transfer an email from client to our folder on a server, but it is rather not used to send emails to another user.
is there any role of FTP or TFTP in sending emails?
No. FTP/TFTP protocols are not used for emails. Those are separate protocols to transfer files (FTP) or for booting from network (TFTP).