Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Frederik Raabye 72 posts 276 karma points MVP 2x c-trib
    Aug 11, 2015 @ 14:07
    Frederik Raabye
    0

    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:

    var listOfTags = new List<EmailTag>();
    listOfTags.Add(new EmailTag("to", "[email protected]"));
    Email.SendUmbracoEmail(nodeId, listOfTags);      
    

    And the resulting exception is:

    ` Kon geen primaire ontvanger voor de e-mail bepalen: Stel een 'to', 'cc' of 'bcc' ontvanger in.`
    

    Debugger confirms that all fields have values. Can you hint at a solution?

  • Wouter van der Beek 20 posts 282 karma points
    Aug 11, 2015 @ 16:13
    Wouter van der Beek
    100

    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.

  • Frederik Raabye 72 posts 276 karma points MVP 2x c-trib
    Aug 11, 2015 @ 18:53
    Frederik Raabye
    0

    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! :)

  • Jeffrey Schoemaker 408 posts 2138 karma points MVP 8x c-trib
    Aug 12, 2015 @ 06:16
    Jeffrey Schoemaker
    0

    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

  • Frederik Raabye 72 posts 276 karma points MVP 2x c-trib
    Aug 12, 2015 @ 08:43
    Frederik Raabye
    0

    Hi Jeffrey

    Thanks! It looks like it is working as expected. Looking forward to see future versions then! :)

    Best regards Frederik

  • kristian schneider 190 posts 351 karma points
    Sep 25, 2015 @ 12:32
    kristian schneider
    0

    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:

     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);
    
  • Jeffrey Schoemaker 408 posts 2138 karma points MVP 8x c-trib
    Sep 25, 2015 @ 12:42
    Jeffrey Schoemaker
    1

    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: enter image description here

    Regards, Jeffrey

  • kristian schneider 190 posts 351 karma points
    Sep 25, 2015 @ 12:48
    kristian schneider
    0

    Hi Jef.

    I had not done that. And setting that up helped

    Thanks Kristian

  • Jeffrey Schoemaker 408 posts 2138 karma points MVP 8x c-trib
    Sep 25, 2015 @ 13:12
    Jeffrey Schoemaker
    0

    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]")

Please Sign in or register to post replies

Write your reply to:

Draft