It appears the tag in the TO field didn't always get parsed properly. I have made a change to the PerplexMail library which should fix this issue.
Jeffrey will upload the updated package tomorrow, so if you check back later you should see the new version ready for download.
To fix this issue in your current solution, simply download the new version of the package and replace the /bin/perplexmail.dll file in your solution with the new .dll from the package zip file. Mind that the name of the file is random but you can find it by it's extension (.dll). Simply copy it to your /bin/ folder and rename it to PerplexMail.dll.
I seem to get the same error, this is with the .dll from the 4/9/2015 16:53 and in umbraco 7.2.8.
The exception is:Additional information: Could not determine the primary recipient for the email. Please specify a 'to', 'cc' or 'bcc' recipient.
My code is pretty much this:
var listOfTags = new List<PerplexMail.EmailTag>
{
new PerplexMail.EmailTag("to", "[email protected]"),
new PerplexMail.EmailTag("firstname", "Jeffrey"),
new PerplexMail.EmailTag("content", "Cool package!")
};
PerplexMail.Email.SendUmbracoEmail(OurContentService.PerplexWelcomeMail, listOfTags);
Exception when sending email
I have set up an email node with a valid sender and the test email function works as expected via the gui.
Experimenting with the package under 7.2.8 I receive an exception when trying to send an email via code.
I have entered [#to#] in the "To" Email and Name fields under the given mail node settings.
My (simplified) code looks like this:
And the resulting exception is:
Debugger confirms that all fields have values. Can you hint at a solution?
Hello Frederik,
Thanks for trying out our package!
It appears the tag in the TO field didn't always get parsed properly. I have made a change to the PerplexMail library which should fix this issue.
Jeffrey will upload the updated package tomorrow, so if you check back later you should see the new version ready for download.
To fix this issue in your current solution, simply download the new version of the package and replace the /bin/perplexmail.dll file in your solution with the new .dll from the package zip file. Mind that the name of the file is random but you can find it by it's extension (.dll). Simply copy it to your /bin/ folder and rename it to PerplexMail.dll.
Hi Wouter
Thanks for the fast reply and fix! Looking forward to experimenting more with the package!
Btw. Exception messages in English would be a plus! :)
Hi Frederik,
as promised by Wouter I uploaded the package with the fix :).
As for English exception messages and the NuGet package (mentioned in your tweet) we will work on that!
Regards Jeffrey
Hi Jeffrey
Thanks! It looks like it is working as expected. Looking forward to see future versions then! :)
Best regards Frederik
Hi.
I seem to get the same error, this is with the .dll from the 4/9/2015 16:53 and in umbraco 7.2.8.
The exception is:
Additional information: Could not determine the primary recipient for the email. Please specify a 'to', 'cc' or 'bcc' recipient.
My code is pretty much this:
Hi Kristian,
first of all thanks for trying out our package :)
Second: Did you specify [#to#] in the to-field in Umbraco, on a global or specific mail-node? Like this:
Regards, Jeffrey
Hi Jef.
I had not done that. And setting that up helped
Thanks Kristian
Hi Kristian,
perfect! There's no magic going on there. It's just two keys and in your code you're specifying which tags should be replaced.
You also could have used [#foobar#] and new PerplexMail.EmailTag("foobar", "[email protected]")
is working on a reply...