From ae539c8d53245ebe5a05341476ba48d7802fe240 Mon Sep 17 00:00:00 2001 From: Dejan Strbac Date: Sun, 20 Dec 2015 11:28:04 +0100 Subject: [PATCH] optional to --- lib/mailex/render.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/mailex/render.ex b/lib/mailex/render.ex index 026e3fc..64d9b30 100644 --- a/lib/mailex/render.ex +++ b/lib/mailex/render.ex @@ -118,8 +118,10 @@ defmodule Mailex.Render do if email.cc && (length(email.cc) > 0), do: headers = [ { "Cc", email.cc |> stringify_addresses } | headers ] + if email.to && (length(email.to) > 0), do: + headers = [ { "To", email.to |> stringify_addresses } | headers ] + [ { "From", email.from |> stringify_addresses }, - { "To", email.to |> stringify_addresses }, { "Subject", email.subject || "" } | headers ] end