How does an e-mail get sent with SMTP and what role does IMAP play?

204 views

How does an e-mail get sent with SMTP and what role does IMAP play?

In: 5

2 Answers

Anonymous 0 Comments

Both are protocols, by which I mean “the ground rules that two computers agree on when talking to each other”.

SMTP is the protocol used for delivering email. IMAP, and for us oldies, POP3 before that, is the protocol used for clients to receive email.

The SMTP conversation itself is verbose and lengthy, but text-based, so you can understand it as a developer. A readable version looks like this:

“`
Sender: Hello!
Mail server: Hello!
S: I have an email from [email protected]
M: 👍🏽
S: It’s going to [email protected]
M: Looks good to me
S: I’m transmitting the email now!
M: no problem, when you’re done say “over and out”
S: <a long email, possibly with binary parts for attachments and images>
S: Over and out.
M: Got it, it’s on its way.
S: Hello!

“`

IMAP has similar verbiage but the commands are oriented around getting emails from the server, and setting the mailbox state (emails read/unread, flagged/starred, etc.)

Anonymous 0 Comments

SMTP is a protocol, which is a list of commands and responses that can be used between an email client (software on your computer) and an email server (a computer typically at your ISP and always online.).

Your computer connects to the server on a specific port where the SMTP software is listening. They speak SMTP commands and responses to each other, including your computer sending the content of your email message. The server looks up routing info for the recipient and forwards the message on. Sort of like the post office.

IMAP is a different protocol. It’s for receiving email from your mailserver. Originally we used POP (POP3) for your email client to talk to your mailbox and receive mail. IMAP is a more enhanced protocol that typically allows for messages to remain in the mailbox and have status data and folders. (Typical POP3 use downloads your incoming email and immediately deletes it from the mailbox on the server, meaning it can be lost forever if your computer/laptop is stolen/destroyed.)