For most email servers, when it receives an instruction to send an email, the message is sent immediately and it won’t be possible for you to cancel an email that is already sent to the recipient. When an email reaches the recipient’s inbox (which normally takes less than 1 second), the only “probable” solution to cancel the email is to ask the server administrator to manually delete the email but the chances are slim because server administrators normally wouldn’t respond to such request as that would be an intrusion of privacy.
Gmail changes this by adding a very unique experimental feature where you can Undo Send emails. Basically after sending an email, you have a maximum of 30 seconds to cancel the sent email by clicking the Undo link. This is made possible by simply adding a queue before Gmail servers sends the email and not by deleting the email on the recipient’s inbox. You can verify this by sending a test email to yourself and you will notice that the email will only arrive in your inbox when the Undo link is removed. This Undo Send feature is disabled by default and only works on web based Gmail.
By default you only have 10 seconds to Undo the sent email but you can set it to 5, 10, 20 or 30 seconds in Settings. Access the Settings page again and this time at the General tab, look for Undo Send and set the Send cancellation period to 30 seconds so that you have the most time to cancel the email.
After enabling the Undo Send feature, whenever you’ve just sent an email, a notice box will appear at the middle top of the page saying “Your message has been sent. Undo. View message“. Simply click on the Undo link to cancel the sent message.
Unfortunately undo sent email only works on the web based email and not on email clients with Gmail’s SMTP. If you close the browser while the message is still in the queue, the email will be sent instantly and there is no way to Undo it even if you managed to re-login to Gmail within 30 seconds.