Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mailmain.Email.parse! usage #84

Open
TylerPachal opened this issue Oct 16, 2018 · 0 comments
Open

Mailmain.Email.parse! usage #84

TylerPachal opened this issue Oct 16, 2018 · 0 comments

Comments

@TylerPachal
Copy link

I am trying to get a very simple example of the email parsing working, here is my code:

def parse_test() do
  email = """
  Message-Id: <[email protected]>
  From: Micah Warren <[email protected]>
  To: [email protected]
  Content-Type: text/plain;
    charset=US-ASCII;
    format=flowed
  Content-Transfer-Encoding: 7bit
  X-Smtp-Server: mail.fusedsolutions.com:[email protected]
  Subject: Plain text only
  Date: Mon, 1 Jun 2009 14:50:15 -0400

  This message contains only plain text.
  """

  Mailman.Email.parse!(email) |> IO.inspect()
end

And here is the output:

%Mailman.Email{
  attachments: [], 
  bcc: [], 
  cc: [], 
  data: %{}, 
  delivery: "",
  from: "", 
  html: "", 
  reply_to: "", 
  subject: "",
  text: "<the whole email is here>",
  to: []
}

I am trying to figure out why the headers are not being parsed correctly. I have tried many iterations and have been unable to get the parse! function to do anything beside for returning the empty defaults.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant