title: How to send unique message in the BCC field of the email?
body: <p>I am trying to establish a mechanize where the any email sent from my users to any person are also documented in a CRM system "if the sender choose to document the email in the CRM."</p>
  
  <p>I can instruct the users to copy an email and drop it in the BCC field where the email will be sent to an email. Then I can take have a corn job that will read the email/parse it and add it to my CRM system.</p>
  
  <p>However, there are two thing that I am unclear on how to do.</p>
  
  <ol>
  <li><p>How can I send unique data in the email itself "not the body"? For example I will need to know what account_id, record_id to related it to after the email is sent. My first thought was to do a base 64 decoding to a jSON string and use that in the email address that being BCCed. But not sure if this works with the email standards.</p></li>
  <li><p>How can my email server know to forward any email to a single email so I only have to read and parse email from one email?</p></li>
  </ol>
  
  <p>I have seen this done in <code>SalesForce.com</code> where a user can BBC and email by using an email like this</p>
  
  <pre><code>`emailtosalesforce@v1hmxvru63wf2rqosh08jd7aw6sgv533qm0dbatsj396kjc8qad.d-ck84eae.na14.le.salesforce.com`
  </code></pre>
  
  <p>the part <code>v1hmxvru63wf2rqosh08jd7aw6sgv533qm0dbatsj396kjc8qad</code> contains data that relate the email message to a single record in the CRM using the account_id/ record_id values.</p>
  
  <p>How can I do this using PHP?</p>
  
  <p>Here is what I have done so far:</p>
  
  <pre><code>$a = array('account_id' =&gt; 123456789,
             'record_id' =&gt; 987654321);
  
  $to = base64_encode(json_encode($a));
  
  $toEmail = 'sentittoCRM@' . $to . 'sub_domain.example.com';
  </code></pre>