AshleyMedway / MailJet.NET

.NET Client for MailJet
MIT License
8 stars 11 forks source link

Can't sent mail with empty body #14

Open hwijntjes opened 8 years ago

hwijntjes commented 8 years ago

MailJetClient.SendMessage(MailMessage) method fails with "Object reference not set to an instance of an object" if MailMessage.body is empty.

AshleyMedway commented 8 years ago

I guess this is sort of by design. Under what circumstance would an Email be sent without a body?

Happy to change this is there is a good reason.

hwijntjes commented 8 years ago

Hi,

The message I want to send is constructed of an ‘alternate view’ and resources. This way a message with embedded images is displayed correctly in GMAIL, Outlook and iOs mail. If I use the body property of the message, the message is not displayed correctly in all clients. So it will get a body in the end, but the field body is not used to construct the message.

Met vriendelijke groet,

Hans Wijntjes

Van: Ashley Medway [mailto:notifications@github.com] Verzonden: maandag 8 augustus 2016 09:19 Aan: AshleyMedway/MailJet.NET MailJet.NET@noreply.github.com CC: Carta Online | Hans Wijntjes Hans.Wijntjes@cartaonline.nl; Author author@noreply.github.com Onderwerp: Re: [AshleyMedway/MailJet.NET] Can't sent mail with empty body (#14)

I guess this is sort of by design. Under what circumstance would an Email be sent without a body?

Happy to change this is there is a good reason.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/AshleyMedway/MailJet.NET/issues/14#issuecomment-238159241, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGJjLbFkepni62-JDQ1Q6MCs50QFoqRHks5qdthYgaJpZM4JdgnY.

AshleyMedway commented 8 years ago

I see, as a current workaround if you duplicate your alternative view html into the body as well as alternative view. The resources will still be embedded.

I will update the code to explicitly use alternative views if they are provided.

hwijntjes commented 8 years ago

Thanks for the quick response.

I believe we already tested this work around, but I think the mail was shown twice on iOS phones. But I will retry this workaround soon.

Met vriendelijke groet,

Hans Wijntjes

Van: Ashley Medway [mailto:notifications@github.com] Verzonden: maandag 8 augustus 2016 10:01 Aan: AshleyMedway/MailJet.NET MailJet.NET@noreply.github.com CC: Carta Online | Hans Wijntjes Hans.Wijntjes@cartaonline.nl; Author author@noreply.github.com Onderwerp: Re: [AshleyMedway/MailJet.NET] Can't sent mail with empty body (#14)

I see, as a current workaround if you duplicate your alternative view html into the body as well as alternative view. The resources will still be embedded.

I will update the code to explicitly use alternative views if they are provided.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/AshleyMedway/MailJet.NET/issues/14#issuecomment-238167111, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGJjLTW2DvkNvsZnElmN3nHfM1In5K7Dks5qduI0gaJpZM4JdgnY.