Closed natiki closed 8 years ago
Could you post some client code that reproduces the error?
Hi Gino,
Been able to track this down some more.... It appears that if we have body of a mail message either being string.Empty or contain spaces then we get the error.
//aMailMessage is passed in and is a System.Net.Mail.MailMessage. It has IsHtml set to TRUE
//Should the message body be empty then MailGun will return the error "Need at least one of 'text' or 'html'"
//So we take care of this here as _MailGunClient does not appear to encapsulate this kind of body well either
if (string.IsNullOrEmpty(aMailMessage.Body))
{
aMailMessage.Body = ".";
}
Reason this is blowing up for me is that this is the first time a user managed to send an email message with no body (we normally append a system footer so that is why I have not seen this before).
Hey Donovan,
(I realise this is ridiculously late, am catching up on a lot of things atm)
Since this is a MailMessage
behaviour and mnailgun
is not encapsulating it in any way (on the contrary). I'm afraid there's nothing precautionary that I could add to the lib, so I'll just close this issue.
Hi,
Appreciate you making this available.
Been using this for almost a year without issue. I am now intermittently (through the same code path as far as I can tell) getting the exception as per the title.
As far as I can tell the mail message being passed to mnailgun is valid. Any ideas or pointers?