How to Generate a Report of Bounced Email Addresses in Gmail

The bounced email report for Gmail lists all the email address that bounced. It also provides the response provided by the recipient's server for rejecting your email.

How to Generate a Report of Bounced Email Addresses in Gmail


Bounced Emails in Gmail

Some email messages you have sent through your Gmail account may not get delivered at all. There could be a problem with the recipient’s email address, like a typo, their mailbox could be full or maybe the mail server could be specifically blocking your emails due to the content of the message.

When an email message sent via Gmail is bounced or rejected, you get an automated bounce-back notice from mailer-daemon@gmail.com and it will always contain the exact reason for the delivery failure along with the SMTP error code. For instance, an error code 550 indicates that the email address doesn’t exist while a 554 indicates that your email was classified as spam by the recipient’s mail server.


How to Get a List of Email Addresses that Bounced

It is important to keep track of your bounced messages and remove all undelivered email addresses from your future mailings as they may affect your sending reputation.

Mail Merge for Gmail keeps track of all your bounced messages in Gmail but if you are not using mail merge yet, here’s an open-source Google Script that will prepare a list of all email addresses that have bounced inside a Google Spreadsheet.

bounce email report in Gmail

Gmail Bounce Report - Getting Started
Here’s how you can get started:

  • Click here to make a copy of the Google Spreadsheet.
  • Open the Bounced Emails menu in your Google Sheet and then select the Run Report option.
  • Authorize the Google Script so it can scan your Gmail account for bounced emails and write them to the Google Sheet. The script runs entirely in your Google account, no data is stored or shared anywhere.
  • Watch as the Google Sheet is populated with rejected and bounced email addresses.
The email bounce report includes the email address that bounced, the reason why that email failed to deliver and the date when the bounce occurred. The spreadsheet will also have a direct link to the bounced message received from mailer-daemon.


Technical Details - How the Script Works

The script uses the Gmail API to fetch a list of all bounced emails in your mailbox.


const findBouncedEmails = () => {
  const { messages = [] } = Gmail.Users.Messages.list('me', {
    q: 'from:mailer-daemon',
    maxResults: 200
  });
  for (let m = 0; m < messages.length; m += 1) {
    const bounceData = parseGmailMessage(messages[m].id);
    if (bounceData) {
      SpreadsheetApp.getActiveSheet().appendRow(bounceData);
    }
  }
};


Next, the script parses the headers of bounced email messages with regex and writes the bounced information to the Google Sheet.

const parseGmailMessage = messageId => {
  const message = GmailApp.getMessageById(messageId);
  const body = message.getPlainBody();
  const [, failAction] = body.match(/^Action:\s*(.+)/m) || [];

  /* If failAction is "delayed", igore message since Gmail will retry it */
  if (failAction === 'failed') {
    /* The X-Failed-Recipients header in Gmail contains the recipient's address */
    const emailAddress = message.getHeader('X-Failed-Recipients');
    /* Get the SMTP error code
       The first sub-field indicates whether the delivery attempt was successful
       (2= success, 4 = persistent temporary failure, 5 = permanent failure). */
    const [, errorStatus] = body.match(/^Status:\s*([.\d]+)/m) || [];
    /* The Diagnostic-Code DSN field contains the actual diagnostic code
       Some mail systems supply no additional information beyond that
       which is returned in the 'action' and 'status' fields. */
    const [, , bounceReason] =
      body.match(/^Diagnostic-Code:\s*(.+)\s*;\s*(.+)/m) || [];
    return [
      message.getDate(),
      emailAddress,
      errorStatus,
      bounceReason.replace(/\s*(Please|Learn|See).+$/, ''),
      `=HYPERLINK("${message.getThread().getPermalink()}";"View")`
    ];
  }
  return false;
};

Inside your Google Sheet, go to the Tools menu and choose Script Editor to view the full source code of the Google Script. You are welcome to reuse / modify the code.

Hope this article is Useful for you ... 



You’ll also like:

How to Copy Draft Emails in Gmail
What is Gmail's Daily Limit on Sending Email?
How to Copy Email Messages from GSuite to a New Gmail Account

Also Like :- 

0 Comments


Buy Perfect Money,Sell Perfect Money,;Exchange;Perfect money in India With Google Pay,PayTm,Upi,Wire Transfer,Imps,Debit or Credit Card

Buy, Sell, Convert, Perfect Money, Bitcoin, BTC to PayPal, Skrill,Neteller

buy perfect money,sell perfect money,exchange perfect money
Buy | sell Exchange rate of perfect money in India

RATE CHANGE TIME TO TIME;
Perfect Money Buy | Sell | Exchange Rate Depended upon Stock availability Call for Current Rate +91-9431530088


How to exchange or Buy Perfect money in India

We are India's Most;trusted and reliable;Perfect Money Exchanger;in India Since 2015,3k Satisfied clients,We accept;IMPS,UPI,GOOGLE PAY,PayTm;,Transactions 24x7 days instant chat support on WhatsApp,Low exchange fee guaranteed,Most secure and safe transaction ,instant order processing;|;Order now;With Whatsapp |+91-9431530088,;

buy perfect money ,Image result for perfect money -buy perfect money in india,send money to india, money transfer to india, buy currency, money to india, e currency exchange, buy forex, best way to send money to india, money online, buy money, best money transfer, ways to send money, sell currency, how to send money to india, webmoney to bitcoin, how to make money online, order currency, forex money exchange, online money transfer to india, buy bitcoin with payza, best way to transfer money to india, cheapest money transfer, make money online, best money transfer to india, neteller bitcoin, e currency exchanger in india, sell dollars, skrill bitcoin, best exchange rate to india, remit to india, money to india exchange rate, buy money online, instant money transfer, easiest way to send money, send money online to india, online fund transfer, buy webmoney, buying and selling currency, paypal to bitcoin exchange, money exchange india, exchange webmoney to bitcoin, order money online, bank of india money transfer, where to buy currency, how to buy currency, convert paypal to bitcoin, buy bitcoin with webmoney, transfer to india, india to us money transfer, internet money, money to india rate, best currency exchange rates, money transfer rate to india, online earning in india, e currency, webmoney paypal, instant exchange, payza exchanger, icici send money to india, bank of india exchange rate, buy bitcoin with solid trust pay, buy currency online india, where to buy us dollars, payza to bitcoin, order currency online, best rate to send money to india, bank of india online money transfer, instant exchangers, easiest way to earn money online, buy usd currency, money changer online, paypal webmoney, transfer money from india, usd to inr buying rate, indian money exchange rate, change pm to bitcoin, buy cash online, exchange neteller to bitcoin, webmoney to btc, buy bitcoin with neteller, buy and sell bitcoin, best currency rates, best rate to transfer money to india, money exchange, bank wire transfer online, order us dollars, buy currency online, best exchange rate, skrill exchange, send money to us, sell neteller, neteller exchanger in bangalore, buy sell currency, earn money from internet, app to send money instantly, exchange bitcoin to webmoney, buy btc with neteller, neteller to btc, webmoney to bitcoin exchange, online currency transfer, best way to send money, sell neteller in india, forex money changer, payza to paypal instant exchange, currency exchange, bitcoin to neteller, online currency purchase, exchange skrill to bitcoin, best e currency exchangers, how can i make money online, credit card wire transfer, currency buying rate, bitcoin dealer in delhi, neteller exchanger in india, send money to bank, money transfer sites, best currency transfer, how do you send money through paypal, webmoney to neteller, internet bank transfer, btc to webmoney, instant wire transfer online, buy btc with webmoney, best things to invest money in, neteller to webmoney, exchange payza to paypal, how to earn money online, neteller exchanger in hyderabad, payza to bitcoin exchange, sell bitcoin neteller, send money to india best rate, neteller to okpay, how to earn money online in india, ways to send money to india, send money to account, cheapest wire transfer, how to get money online, buy and sell forex, sending money from india, buy neteller money, skrill exchanger in india, buying currency online best rates, best online money transfer to india, transfer funds to india, convert webmoney to bitcoin, where to buy money, buy with neteller, how to exchange money in india, best online currency rates, want to invest, where best to invest money, online earning ways, buy bitcoins with okpay, money from india, how to invest money, how to transfer money to india, buy e currency, exchange payza to bitcoin, account money transfer, send money to india instantly, convert bitcoin to webmoney, bitcoin to webmoney exchange, online funding, buy payeer, buy skrill, paypal money transfer, send money to bank account, money transfer sites in india, online currency exchange, best remittance to india, can you buy money, get money online, how do i send money, how to make money via internet, ways to earn money on the internet, send money from india to us, best us dollar rate, best place to invest, how do i send money via paypal, ways to make money, cash wire transfer, currency rate, indian money online, money transfer website in india, neteller currency exchange, sell bitcoin india, neteller dollar buy, ways to transfer money to india, wire money to india, buy skrill money, paypal send money to india, send money to india bank account, e exchange, money earning websites, how to buy dollars, exchange skrill to payeer, payza to webmoney, send money to india rates, advcash india, online remittance to india, send money instantly, how to wire money to a bank account, sell skrill, neteller dollar buy sell, best usd rate, buy pm, transfer money from payza to neteller, international wire transfer services, buy a money, exchange neteller to okpay, how to send money online to india, best place to sell currency, e currency in india, bank money transfer, best place to sell dollars, i want to make money, transfer from bank to paypal, send money from bank account to bank account, transfer funds from bank to bank, wire transfer funds, online currency rate, bitcoin to payza, neteller seller in india, ways to wire money online, send money to india with credit card, online money bank, bank transfer to india, how to buy and sell forex, transfer funds to bank account, paypal send money using bank account, forex exchange rate, cash currency exchange, how to buy webmoney, fastest way to send money, bitcoin buy or sell, transfer money to bank account, india to india money transfer, sell currency online india, paypal to btc exchange, instant money, how to make money on the internet, how to get money from paypal to bank account, money transfer india to india, buy or sell forex, online money earning sites, to buy us dollars, sell buy forex, best currency converter, online earn money website, best money transfer website, best currency exchange deals,



We Offer Following Services;

#1.Buy Perfect Money in India
#2.Sell Perfect Money in India
#3.Exchange Perfect Money in India



Exchange Perfect money($) into INR;

Buy Perfect Money;Online or If You Want To Sell Then We Pay Directly in Your Bank. (Cash;Deposit or Online Transfer),We will Send;Moneyin Your Account With In 2 Hour, in some circumstances We Take Some More Time.;

buy perfect money,perfect money india,sell perfect money,exchange perfect money into inr
BUY | SELL EXCHANGE PERFECT MONEY