Apple mail to eml

A common request!

There are a few ways to convert Apple Mail emails to EML format. Here are a few methods:

Method 1: Using Apple Mail's built-in export feature

  1. Open Apple Mail and select the emails you want to export.
  2. Right-click (or control-click) on the selected emails and choose "Export Mailbox..."
  3. In the "Export Mailbox" window, select "EML" as the export format.
  4. Choose a location to save the exported emails and click "Export".

Method 2: Using a third-party email converter

  1. Download and install a third-party email converter like "Mail Converter" or "EML Converter".
  2. Launch the converter and select Apple Mail as the source email client.
  3. Choose the emails you want to convert and select EML as the output format.
  4. Follow the converter's instructions to complete the conversion process.

Method 3: Using a command-line tool

  1. Install the "mbox2eml" command-line tool using Homebrew (on macOS) or a package manager (on Linux).
  2. Open a terminal and navigate to the directory containing the Apple Mail mailbox files (usually ~/Library/Mail/V2/Mailbox).
  3. Run the following command to convert the mailbox to EML format:
    mbox2eml -o output.eml mailbox.mbox

    Replace output.eml with the desired output file name and mailbox.mbox with the name of the Apple Mail mailbox file you want to convert.

Method 4: Using a script

  1. Create a new AppleScript file (e.g., "Convert to EML.applescript") and add the following code:
    tell application "Mail"
     set theMailbox to mailbox "Inbox"
     set theMessages to every message of theMailbox
     repeat with i from 1 to count of theMessages
         set theMessage to item i of theMessages
         set theSubject to subject of theMessage
         set theBody to body of theMessage
         set theDate to date received of theMessage
         set theFrom to from of theMessage
         set theTo to to of theMessage
         set theCC to cc of theMessage
         set theBCC to bcc of theMessage
         set theAttachments to attachments of theMessage
         set theEML to ""
         set theEML to theEML & "From: " & theFrom & " " & theDate & " " & theSubject & "rn"
         set theEML to theEML & "To: " & theTo & "rn"
         set theEML to theEML & "CC: " & theCC & "rn"
         set theEML to theEML & "BCC: " & theBCC & "rn"
         set theEML to theEML & "rn"
         set theEML to theEML & theBody & "rn"
         repeat with j from 1 to count of theAttachments
             set theAttachment to item j of theAttachments
             set theEML to theEML & "Content-Type: application/octet-stream; name=\"" & name of theAttachment & "\"rn"
             set theEML to theEML & "Content-Disposition: attachment; filename=\"" & name of theAttachment & "\"rn"
             set theEML to theEML & "rn"
         end repeat
         set theEML to theEML & "rn"
         set theFile to "output" & i & ".eml"
         set theFile to POSIX file theFile
         set theEML to theEML as string
         set theEML to theEML & "rn"
         write theEML to theFile
     end repeat
    end tell
  2. Save the script and run it using the "Run Script" menu item in Apple Mail.

These methods should help you convert your Apple Mail emails to EML format.