The 'undo' link, to the right of the message-sent confirmation, will appear for five seconds after the email is sent.

If you sometimes fire off an impulsive email to your boss or your ex, hit send, and then immediately regret it, you are probably the type of person Google had in mind when it came up with the latest feature for its Gmail service.

An "undo" link now appears next to the confirmation that your email has been sent, Google announced on the Gmail blog Thursday afternoon.

The link is active for five seconds after you send the email. During the time, Gmail holds the email instead of sending it right away, just in case you need to take it back.

Michael Leggett, user experience designer for Google, wrote in the blog that he once accidentally sent an email to "the wrong Larry," and that "pushed me over the edge."

"I could undo just about any other action in Gmail — why couldn't I undo send?" he wrote.

Leggett said he chose the five-second window because he thought that would be enough time to catch most "regrettable" emails.

The feature is only available to people who compose their email online through the Gmail website (as opposed to offline email software such as Outlook or Thunderbird) and who have turned it on in their settings under the "lab" tab.

The "undo" link is not the first such feature to be offered by an email provider. Novell Groupwise, a paid email service, also allows the sender to retract unopened emails.

AOL, another provider of free email services, used to have an "unsend" feature that deleted messages from the recipient's mailbox as long as the recipient had not opened it.

However, it announced on its blog in April 2008 that it had removed that and another feature because with the way they were implemented, "they were preventing us from achieving the best product performance."