c# - Sendgrid System.ArgumentException: Unknown element: html -
i've update following packages latest version:
a) sendgrid.smtpapi updated 1.3.1
b) sendgrid update 6.0
and webtransport.deliver method not there anymore - no problem, i've switched deliverasync method strange error, it's supposed fixed since 2 years ago:
system.argumentexception: unknown element: html
this part of stack trace can of interest:
system.argumentexception: unknown element: html
at sendgrid.errorchecker.checkforerrors(httpresponsemessage response, stream stream)
at sendgrid.errorchecker.d__0.movenext()
--- end of stack trace previous location exception thrown ---
at system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task)
at system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task)
at sendgrid.web.d__0.movenext()
--- end of stack trace previous location exception thrown --- @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task)
and how email sending code looks like:
sendgridmessage emailmessage = new sendgridmessage(); emailmessage.addto(user.completeregistrationmodel.useremailaddress); emailmessage.from = new mailaddress(configurationhelper.emailsenderaddress, configurationhelper.emailsendername); emailmessage.enabletemplateengine(configurationhelper.confirmationemailtemplateid); emailmessage.addsubstitution("-urlaplicatie-", new list<string>() { string.format("{2}{0}{1}", user.completeregistrationmodel.companyurlprefix, configurationhelper.domainsuffix, configurationhelper.applicationaccessprotocol) }); emailmessage.addsubstitution("-username-", new list<string>() {user.completeregistrationmodel.useremailaddress}); emailmessage.addsubstitution("-confirmationurl-", new list<string>() {user.completeregistrationmodel.useremailaddressconfirmationcompleteurl}); emailmessage.subject = string.format("{0}{1}", user.completeregistrationmodel.companyurlprefix, configurationhelper.domainsuffix); emailmessage.text = " "; emailmessage.html = " "; web webtransport = new web(new networkcredential(configurationhelper.sendgridusername, configurationhelper.sendgridpassword)); try { await webtransport.deliverasync(emailmessage); } catch (invalidapirequestexception exception) { elmah.errorsignal.fromcurrentcontext().raise(exception); }
can, please, tell me happening?
thank you, evdin
please update 6.0.1, there bug in 6.0.0 , unlisted. thanks.
https://github.com/sendgrid/sendgrid-csharp/blob/master/changelog.md
Comments
Post a Comment