Gmail does not literally unsend SMTP messages. To give you time to undo, Gmail delays sending the message for a few seconds. So if you don't select "Undo" within the time limit, your message will be sent.
How to use: https://support.google.com/mail/answer/1284885?hl=en