Email Body Extraction

Can I extract the body of a message from an email that has been routed to a worker? I tried extracting the raw message from EmailEvent but there was everything else except the body.

export default {
  async email(message, env, ctx) {
    const reader = message.raw.getReader();
    const { value, done } = await reader.read();
    const emailContent = new TextDecoder().decode(value);
  }
}
Was this page helpful?