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: <F5B196D4-10CD-4876-822F-59C5C39D520E@fusedsolutions.com>
From: Micah Warren <micahw@fusedsolutions.com>
To: test@devmicah.fusedsolutions.com
Content-Type: text/plain;
charset=US-ASCII;
format=flowed
Content-Transfer-Encoding: 7bit
X-Smtp-Server: mail.fusedsolutions.com:micahw@fusedsolutions.com
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.
I am trying to get a very simple example of the email parsing working, here is my code:
And here is the output:
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.