title: How to get Gmail message id upon sending the mail?
body: <p>I'm using the java mail API to send mails with a Gmail Account. My requirement is, when sending the mail, I need the message id (<strong>or some unique id for email</strong>) to store some additional info in my local database.</p>
  
  <p>Since the Transport.send() method returns no value, I can't get an ID for the mail?</p>
  
  <p>So two questions:</p>
  
  <p>1) Can anybody help me with a way to get the Gmail id for the mail, upon sending?</p>
  
  <p>2) Is the "Message-ID" the unique identifier for the mail?</p>
  
  <p>Thanks in advance.</p>