I am looking for a browser extension (preferably Chrome) or web-app that can add some option in the Gmail interface that allows me to reply to an e-mail I received with a standard "Undelivered mail" message in Gmail like:

---------- Forwarded message ----------
From: Mail Delivery Subsystem <[email protected]>
Date: Sat, Jun 21, 2014 at 12:38 PM
Subject: Delivery Status Notification (Failure)
To: [email protected]

Delivery to the following recipient failed permanently:

     [email protected]

Technical details of permanent failure:
The email account that you tried to reach does not exist. Please try double-checking the recipient's email address for typos or unnecessary spaces. Learn more at http://support.google.com/mail/bin/answer.py?answer=6596

----- Original message -----

Return-Path: <[email protected]>
Received-SPF: pass (google.com: domain of [email protected] designates as permitted sender) client-ip=
Authentication-Results: mr.google.com;
       spf=pass (google.com: domain of [email protected] designates as permitted sender) [email protected];
       dkim=pass [email protected]
X-Received: from mr.google.com ([])
        by with SMTP id vv7mr11097164bb.62.1403368684729 (num_hops = 1);
        Sat, 21 Jun 2014 09:38:04 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
X-Received: by with SMTP id vv9mr1199716lbb.62.1403368684724;
 Sat, 21 Jun 2014 09:38:04 -0700 (PDT)
MIME-Version: 1.0
Received: by with HTTP; Sat, 21 Jun 2014 09:37:44 -0700 (PDT)
From: Franck Dernoncourt <[email protected]>
Date: Sat, 21 Jun 2014 12:37:44 -0400
Message-ID: <CA+e8+riJKFVsGAxv1aaR+LLoDeK8Tx5cZRvQZ=GnrkMNy-SvJA@mail.gmail.com>
Subject: test
To: [email protected]
Content-Type: multipart/alternative; boundary=089e01160caef1279604fc5b3b1c

spam spam spam

1 Answer 1


I'm not sure if I fully understand your question. If you want to automate this, I can't recommend google apps script enough(I can help more indepth with that if needed but that's more suited with the google apps script SO tag). If you wanted something like boomerang where you have an extra button next to all the normal gmail buttons, I think that's done by an extension and I would look to https://stackoverflow.com/questions/8689905/gmail-extension-gadget-api-how-to-add-a-button-to-the-compose-toolbar but this seems inherently more complicated...I think a less involved way(it depends on how much you have invested in a solution and how well you can program) would be to make a bookmarklet or a simple chrome extension that doesn't add a button but opens a new window to make a new email ON CLICK not automatically.

What I've Found So Far

If you want to go the bookmarklet route I think document.querySelectorAll(".gs")[1].children[5].children[0].innerText gets the innerText of the message, then it'd be simple javascript string functions to extract the email out of it. Then, window.open that link prefixed by "mailto:". I.E. let's assume you get the email down to variable email. Then window.open("mailto:"+email) should open your default mail client. Personally, since you wanted to click a button in gmail, you might as well do a bookmarklet


The only part of this that is variable is that querySelectorAll part because if gmail changes much of its internal layout, it will break. I don't have a good answer except play around with the chrome development tools until you find a path

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.