Nibble

New Package - Mail Engine

This is a first version of a new mailer for umbraco v4. It’s similar to the ultrasimplemailer but one main difference is that it isn’t a datatype but it’s a new item in the context menu. Since it needs rendertemplate support it’s only possible to use it with v4.0.1 and upper versions.

 

Intro

After Installation you’ll have a new item in the context menu: send as mail.

contextmenumailer

Hitting this option will open a new modal. Where you’ll be able to send a published document as a mail.

mailer1

The document needs to be published because the mail contents will be fetched from the rendered document output. Trying this on an un-published document will result in an error message.

mailer2

In the first step you’ll need to supply:

  • From emailaddress
  • From display name
  • Subject (this will be the document name but can be chanched)

 

mailer3

And choose to send it to a single email address or to multiple (mass option).

When sending a single mail you’ll just need to supply an email address. If a member is found with that email address his data will be merged (more about the merging below).

mailer4

Choosing the mass option will allow to select a membergroup and to supply a filter.

For example if you have a property on your membertype with the alias unsubscribe of the type true/false and you only want to send to members that don’t have this set to true.

You can supply the filter

unsubscribe@,0

mailer5

Once everything is set it’s just a matter of hitting the send button and you’ll see the progress in the status part.

 

Merging member data

It’s possible to merge member data. If one of these are found then they will be replaced

  • [memberId]
  • [memberName]
  • [memberLoginName]
  • [memberPassword]
  • [memberEmail]

Custom properties are also possible

  • [custompropertyalias]

So something like

Hi [memberName],

Your password is: [memberPassword]

Will be recieved by the member as

Hi John,

Your password is: 1234

 

Images

Another detail is that if there are images they will be added as a linked resource.

 

Extra

The package will also add an xslt extension, making it possible to send a rendered page directly to an email address or a member from xslt (with merging of data).

And it’s also possible to use the methods from .net.

A quick example:

I have setup a forgot password page that looks like this when previewed:

mailpassword

And I would like to use the asp.net PasswordRecovery control to send this mail instead of the regular passwordrecovery mail.

So all I need to do is override the PasswordRecovery mail using the SendingMail event.

 protected void PasswordRecovery1_SendingMail(object sender, MailMessageEventArgs e)
        {
            Library.SendMailFromPageToMember(“test@nibble.be”,
                Member.GetMemberFromLoginName(PasswordRecovery1.UserName),
                “Password recovery Mail”,
                1056);
 
            e.Cancel = true;
 
        }

And call the SendMailFromPageToMember method, supply a from email address, the member (using umbraco.cms.businesslogic.member)  , the subject and the id of the page.

The result:

mailer6

Mail Engine Package download

72 Comments so far

  1. Thomas Höhler on April 8th, 2009

    Nice Package,

    very usefull for some of my private projects.

    Thomas

  2. Søren Sprogø on April 8th, 2009

    Oh gosh, brilliant!

    This was one of my last excuses for not upgrading to v4.

  3. Jan Skovgaard on April 8th, 2009

    This looks really nice. Great work!

  4. David Conlisk on April 8th, 2009

    Fantastic - thanks for sharing Tim!

  5. Leandro on April 8th, 2009

    Amazing. Great work!

  6. horsted on April 8th, 2009

    Amazing work as always - can’t thank you enough!

  7. Christian Palm on April 8th, 2009

    Top nice

    Can it handle server restart? (start up again, from the point where app pool was recycled)

  8. Aaron Powell on April 8th, 2009

    Would it be possible to have the from email/ name auto populate from the current logged in User account? That’d seem logical often you’re logged in as the account you want to mail as.

  9. Søren Tidmand on April 8th, 2009

    Tim, you rock again! … have been waiting anxiously for this package. I’ll make it spin right away.

  10. Søren Sprogø on April 8th, 2009

    Hmmmm, one issue springs to mind: Is it possible to restrict it, so a customer is only able to [send as email] on certain document types?

    I imagine this workflow for typical novices:

    You would normally create a news item in you news archive, and then think “Hmmm, I’d like this send out as a newsletter also”. Right click the news item, and send it to all subscribers.

    But as you prolly know, sending a regular web page as an email will result in a garbled message. You need a separate, much simpler template for emails and newsletters.

  11. Tim Geyssens on April 8th, 2009

    @Christian nope not in this version, will be in the ‘advanced’ version

    @Aaron nice idea

    @Soren, that should be possible with the user permissions.

  12. Petr Snobelt on April 8th, 2009

    Thank you for nice package

  13. Gerty on April 8th, 2009

    Can’t wait to test it, looks very good! :)

  14. Paul on April 9th, 2009

    Hey Tim,

    Great package, any chance of getting the source? This would be a great framework to start from when intergrating with out external email sending software.

    Also whats the advanced version got in store?

    Cheers

    Paul

  15. Mario on April 9th, 2009

    Tim, you are perfect. Got my weekend.

    Mario

  16. Jesper irdrup on April 11th, 2009

    Sounds great Tim. Looking forward to trying it out. I hope that the Google Analytics code from my version stayed? Is it Open source?

    Thanks
    Jesper

  17. Mike McCullough on April 12th, 2009

    I haven’t been able to upgrade from 3.06 to v4.01 until I could get the newsletter function working. This is another great package! Let’s see if it can handle my 5000 members.

  18. Josh Reid on April 14th, 2009

    Thanks Tim!!!
    Perfect- have been waiting with bated breath & can finally now get upgrading through to v4(.01).
    I too agree with auto populating the from email and name, from logged user (or maybe even based on a memberGroup basis, as properties of the group, so this could populate on selection of a particular group)?

  19. Søren Linaa on April 15th, 2009

    Hi Tim
    Great package, thanks for sharing it with us.
    One thought… Would it be posible to select an alternate template, so I can make a special email template so I can have two templates. One for the live content on the site and one specially optimized for email content.

  20. G Crolla on April 16th, 2009

    The zip file is corrupt and I can’t install it. (unexpected end of archive).

  21. Tim Geyssens on April 16th, 2009

    @G Crolla works fine here, please try downloading again.

  22. Tim Geyssens on April 17th, 2009

    New version uploaded, bug was found, AddMailingActionEvent caused content and media picker to stop working.

    This is now resolved.

  23. G Crolla on April 20th, 2009

    Thanks have installed the package but cannot view the [send as mail} option in the context menu. Am I missing something? I’ve upgrade to umbraco v 4.0.1.

    Thanks

  24. G Crolla on April 20th, 2009

    Hi ignore my last email. I deployed to the dev server and it worked fine.

    I was using in on my local machine and it didn’t work!

    Thanks for sharing it with us

  25. Jeff on April 29th, 2009

    Hi I am just trying out your email package with password recovery - one proble my umbraco library doesn’t contain a method - Library.SendMailFromPageToMember, can you tell me where to source it from?
    Thanks Jeff

  26. Tim Geyssens on April 29th, 2009

    @Jeff, it’s not the umbraco library but it’s the mail engine library that has the method.

  27. JC on April 30th, 2009

    Great package, but i cant get it to work.

    When try sendt “single”, nothing happens. i get and small error box saying:

    Line: 4724
    Char: 21
    Sys.webForms.PageRequestManagerServerErrorException: Failure sending mail.

    When trying “Mass” nothing happens just stays at 0 %

    Is there something i miss in the installation?

  28. Tim Geyssens on April 30th, 2009

    @JC did you install it on a v4.0.1 site ?

  29. Simon Probert on May 1st, 2009

    Nice work!

    How would you go about automating it so that it sends mails automatically (eg. when a new document type is created) to group members depending on parameters they set themselves in their profile?

    SP

  30. Simon Probert on May 1st, 2009

    OK I just read it again - it’s to do with the filters on the Mass email option… Excellent can’t wait to try it out :)

  31. Søren Tidmand on May 1st, 2009

    Hi Tim,
    Today I had the following “issue” with the mailer engine. After having pushed the send button, it worked nice until 61% … at this point it froze. I don’t know for sure whether all 775 recipiants have actually received the newsletter.
    Have you had any experience with this occurance.
    /Søren

  32. Lefteris on May 4th, 2009

    What about smtp authentication? (host, user, pass)
    It is a must to support it.

  33. Tim Geyssens on May 4th, 2009

    @Lefteris, sure that shouldn’t be a problem since the mailer uses the settings from the system.net mailSettings in the web.config

  34. Robin on May 12th, 2009

    Nice work, however I get an error, Failed to send mail.

    Is there something with smtp ?

  35. Peter Gregory on May 15th, 2009

    Hi Tim

    We are trying out your mail engine to send out our newsletter. Firstly a couple things it would be nice if the single send put some sort of message up to say it had suceeded. 2ndly when we set it to send to our subscription of 4700ish members it changed the status of the progress bar to waiting and then never changed? Is it sending??? !!!?? or is it just hung up because it couldnt process that many requests? There are no errors or anything ? When updating the status bar does it update after every send?

    Thanks

    Peter

  36. Karsten Gråbæk on May 15th, 2009

    Hi There,

    We are having some problems with the Danish charaters when sending out mails.. It replaces ÆØÅ with funny looking charaters.. We have tried to set the template with:

    But it does not do the trick.. Can you help?

    All the best,

    Karsten, attityde.dk

  37. Karsten Gråbæk on May 15th, 2009

    meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″

  38. Scott Hugh Alexandar Petersen on May 17th, 2009

    I am getting an error which says:

    Failed to map path: /media/image/746/1.

    The reason it gives this error is because there is a dot in the file name.

    I also get an error when using imageGen to resize the images.

    Thanks

  39. Scott Hugh Alexandar Petersen on May 17th, 2009

    I believe you should change your regexp to

    string pattern = “href=\”?([^\\\”‘>] )|src=\\\”?([^\\\”‘>] )|background=\\\”?([^\\\”‘>] )”;

    instead of

    string pattern = “href=\”?([^\\\”‘ >] )|src=\\\”?([^\\\”‘ >] )|background=\\\”?([^\\\”‘ >] )”;

    as I pressume that the space you are looking for is coming after the ” or ‘ symbol.

    Just a thought.

  40. Scott Hugh Alexandar Petersen on May 17th, 2009

    Oh and about the danish characters then you should probably have something like:

    message.BodyEncoding = System.Text.Encoding.UTF8;
    message.SubjectEncoding = System.Text.Encoding.UTF8;

    in your code.

  41. Scott Hugh Alexandar Petersen on May 17th, 2009

    Tim just to emphasize and to show that it is not all bad then I love your emailengine!

    Regards,

    Scott

  42. Jacob T. Nielsen on May 18th, 2009

    Thanks a million. Great package and a total life saver :D

  43. Lefteris on May 18th, 2009

    Tim,
    can you please fix the UTF8 issue and publish again the package?
    Thank you.
    Any source code? Where?

  44. Lefteris on May 20th, 2009

    I’ve loaded a project with 10.000 members in 10 groups.
    When I click [Send as email] the modal take too many time to load.
    Some times the page expires.
    Also during loading sqlserver process takes 60-90% cpu load.

    If you please check it and update the project?

    Thanks in advance.

    (When to expect pro version?)

  45. Daniel Johannsen on May 28th, 2009

    Is there any workaround for the UTF8/encoding-problem?
    @Karsten Gråbæk: Changing the content type in the template doesn’t do the trick for me.

  46. Paul Hulatt on May 28th, 2009

    Trying to send a mail to a group with 638 members and the Mail Engine stops sending at 11% everytime?

    I tried removing the email that it stopped on from the group but it just stopped on the next one. When it stops the Send button becomes clickable again but the status says “Sending to name@email.com“.

    What order are the emails sent to members? Is there anyway to specify in the filter to send to the ones that have been missed NodeId>xxx or CreateDate>xxx?

  47. Scott Hugh Alexandar Petersen on June 3rd, 2009

    Tim are you still here?

  48. Tim Geyssens on June 3rd, 2009

    Hi, currently I don\’t have the time to get to the bottom of the issues. So I uploaded the sourcecode. You can download it here:

    http://www.nibble.be/temp/MailEngine.zip

  49. Scott Hugh Alexandar Petersen on June 3rd, 2009

    Perfect Tim - thank you.

  50. Antonio A. Ganoza on June 5th, 2009

    Thanks for the great info

  51. Simon Dingley on June 16th, 2009

    I know we discussed this previously and I appreciate you don’t have a lot of time on your hands to try and resolve the issues mentioned above so perhaps adding this project to CodePlex is still the way forward. That way it takes some of the pressure off of you to fix any issues or make enhancements.

    I appreciate the efforts on this package and more so for releasing the source!

  52. Scott Hugh Alexandar Petersen on June 17th, 2009

    I agree with Simon!

    Great work for sure.

    Thanks Tim.

  53. Robert on January 7th, 2010

    Hi Tim,

    I know you posted source code, but I am having the same issue as Paul Hulatt. Stops for me @ 13%. Tested on 2 different servers, same behavior.

    Do you know if anyone has fixed this in the source code?

    Any help on it would be greatly appreciated.

  54. baris ozer on January 15th, 2010

    Hi Tim;

    I can install this pack but I can using this error

    Server Error in ‘/’ Application.
    ——————————————————————————–

    Please verify whether file eo_web.ashx is on your web application’s root directory. That file is required for EO.Web Controls to run in your application. If the file does not exist, please copy it from EO.Web Controls’ installation folder.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Web.HttpException: Please verify whether file eo_web.ashx is on your web application’s root directory. That file is required for EO.Web Controls to run in your application. If the file does not exist, please copy it from EO.Web Controls’ installation folder.

    Source Error:

    Line 38:
    Line 39:
    Line 40:
    Line 41:
    Line 42:

    Source File: c:\inetpub\vhosts\ozer.gen.tr\httpdocs\umbraco\dialogs\mailing.aspx Line: 40

    Stack Trace:

    [HttpException (0×80004005): Please verify whether file eo_web.ashx is on your web application’s root directory. That file is required for EO.Web Controls to run in your application. If the file does not exist, please copy it from EO.Web Controls’ installation folder.]
    EO.Web.Internal.bh.a() 62
    EO.Web.Internal.bh.c() 134
    EO.Web.Internal.bh.a(HttpApplication A_0, Boolean A_1) 163
    EO.Web.Internal.ev.a(Boolean A_0, HttpApplication A_1) 197
    EO.Web.Control..ctor(Type implType) 80
    EO.Web.ScriptManager..ctor() 25
    ASP.umbraco_dialogs_mailing_aspx.__BuildControlScriptManager2() in c:\inetpub\vhosts\ozer.gen.tr\httpdocs\umbraco\dialogs\mailing.aspx:40
    ASP.umbraco_dialogs_mailing_aspx.__BuildControlform1() in c:\inetpub\vhosts\ozer.gen.tr\httpdocs\umbraco\dialogs\mailing.aspx:35
    ASP.umbraco_dialogs_mailing_aspx.__BuildControlTree(umbraco_dialogs_mailing_aspx __ctrl) in c:\inetpub\vhosts\ozer.gen.tr\httpdocs\umbraco\dialogs\mailing.aspx:1
    ASP.umbraco_dialogs_mailing_aspx.FrameworkInitialize() in c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root4ad2b9d\58533826\App_Web_mailing.aspx.10695ae8.777sl_1i.0.cs:0
    System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 56
    System.Web.UI.Page.ProcessRequest() 80
    System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) 21
    System.Web.UI.Page.ProcessRequest(HttpContext context) 49
    ASP.umbraco_dialogs_mailing_aspx.ProcessRequest(HttpContext context) in c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root4ad2b9d\58533826\App_Web_mailing.aspx.10695ae8.777sl_1i.0.cs:0
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 181
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 75

    Where I wrong?
    Thank You
    Regards

  55. Robert on February 20th, 2010

    This should fix it:
    Go to http://www.essentialobjects.com/ and download the demo version. Install it. Now you can do a search for the file eo_web.ashx. Once found place a copy of that file into the root of you Umbraco application (in your case its c:\inetpub\vhosts\ozer.gen.tr\httpdocs\).

    That outta do it

  56. Brian Hvarregaard on June 15th, 2010

    Hi, Im having the problem with the danish characters. Did anyone manage to solve the problem, or compile a new package where it works?

  57. Aron Gamble on June 16th, 2010

    I’m getting the issue with the mass send failing at about 43%. Apparently someone has produced a patch - does anyone know where you can get it? Someone also fixed the UTF-8/strange characters problem - does anyone know what the fix was?

    Aron

  58. Ivan on August 11th, 2010

    Hi Tim.

    Does Mail Engine work with Umbraco 4.5?

    Thanks in advance!
    Ivan

  59. Ulla on August 28th, 2010

    Hi Tim

    First of all - great package. i just can’t make it work.
    It’s installed fine, I’ve setup my email template and a test page, but when i chose ’send as email’ and try to send it, it just says ‘Sending Started’, but never gets any further.

    my email configuration is as follows, can it have anything to do with that?:

    Please help, The package is just what I’ve been looking for - If only I could make it work ;)
    Cheers
    // Ulla

  60. happyfanaticsalsero on October 26th, 2010

    Hi all,

    Just wanted to share: I’m running Umbraco 4.5.2 and have just successfully installed the mailer package after tackling some minor problems. Just want to share back to the community how I went about them:

    1. Download and install the demo version of essential objects so you can get the latest dll. Especially if you’re running .NET 4.0 as I am, you’ll need it because otherwise you will crash with an error when clicking on the send mail action in your content tree. It gives a rather strange error, complaining about the EO.Web dll being confused between .NET 1.1 and 2.0, where it actually is all about the dll not being the one for .NET 4.0.

    2. If you would just copy that over the existing dll in the bin of umbraco after installing the package, you will encounter the next error. To be expected… the reference is to a specific version of the EO.Web dll. To fix this, I downloaded the source code of the mailer package and removed added the reference to the dll again. Rebuild copy that dll in the bin folder of umbraco.

    Right click on a node in your content tree and click on the send as e-mail action. Voilà, you’ve got the mailer package running in Umbraco 4.5.2 & under .NET 4.0.

    This is also an answer to anyone: yes, it also runs on Umbraco 4.5.*.

    Kind regards,
    HFS

  61. Siw on November 5th, 2010

    Hi all
    Anyone know what the limit on number of recipients is?

  62. Clarus on January 23rd, 2011

    Please tell me how to use this system

  63. Tony Kiernan on February 28th, 2011

    >>To fix this, I downloaded the source code of the mailer package and removed added the reference to the dll again. Rebuild copy that dll in the bin folder of umbraco.

    Fantastic! Now, where would I find this source code? (Or a link to your updated dll)

  64. Wim on April 15th, 2011

    A nice peace of work. Just installed it with .net 4.0 fixes mentioned above in Umbraco 4.7.

    Still have to stress-test it with some more users, but for testing purposes works as a charm.

  65. Wim on July 18th, 2011

    For anyone playing around with this code: mass mailing fails with an error above Umbraco v4.6.

    A solution is available at http://our.umbraco.org/forum/ourumb-dev-forum/bugs/17348-RenderTemplate-problem-Error-generating-macroContent

  66. max on January 13th, 2012

    this does not work with umbraco version 4.7 with asp.net 4.0 it only works with asp.net 2.0 that is the error i got
    any idea why

  67. TimNape on March 1st, 2012

    Hi , I would like to test and implement - where do I download from?

  68. Sarah on April 3rd, 2012

    Great resource. I’m a bit new to this - am I right in thinking images would need to be hosted on a server to be attached/sent with an email?

  69. Sarah on April 3rd, 2012

    Another query! Is there a limitation to number of subscribers/number of emails that can be sent per ‘campaign’ shot?

  70. Eaglefox on July 23rd, 2012

    does this work with Umbraco 4.7.2?

  71. Paul on December 17th, 2012

    I had this working in 4.7.1 and then I upgraded to 4.11.1 and now it fails due to a rewrite of RenderTemplate. I have reported this issue so I hope it get’s fixed

  72. Medjeti on April 28th, 2014

    Hi Tim (or anybody else),

    Any workaround to get this package working in a newer Umbraco install?

    It’s been working great on a small website I manage, but since upgrading (v. 6.1.5) it does not appear on the list of installed packages, and the context menu for sending e-mail is gone as well.

    Thanks for any input!

Leave a Reply