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

Can't sent mail with empty body #14

Open
hwijntjes opened this issue Aug 5, 2016 · 4 comments
Open

Can't sent mail with empty body #14

hwijntjes opened this issue Aug 5, 2016 · 4 comments
Assignees
Labels

Comments

@hwijntjes
Copy link

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

@AshleyMedway
Copy link
Owner

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
Copy link
Author

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//issues/14#issuecomment-238159241, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGJjLbFkepni62-JDQ1Q6MCs50QFoqRHks5qdthYgaJpZM4JdgnY.

@AshleyMedway
Copy link
Owner

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.

@AshleyMedway AshleyMedway self-assigned this Aug 8, 2016
@hwijntjes
Copy link
Author

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//issues/14#issuecomment-238167111, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGJjLTW2DvkNvsZnElmN3nHfM1In5K7Dks5qduI0gaJpZM4JdgnY.

Repository owner deleted a comment from JohannesZettl Aug 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants