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.
Hitting this option will open a new modal. Where you’ll be able to send a published document as a mail.
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.
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)
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).
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
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:
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:
Mail Engine Package download

Nice Package,
very usefull for some of my private projects.
Thomas
Oh gosh, brilliant!
This was one of my last excuses for not upgrading to v4.
This looks really nice. Great work!
Fantastic - thanks for sharing Tim!
Amazing. Great work!
Amazing work as always - can’t thank you enough!
Top nice
Can it handle server restart? (start up again, from the point where app pool was recycled)
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.
Tim, you rock again! … have been waiting anxiously for this package. I’ll make it spin right away.
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.
@Christian nope not in this version, will be in the ‘advanced’ version
@Aaron nice idea
@Soren, that should be possible with the user permissions.
Thank you for nice package
Can’t wait to test it, looks very good!
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
Tim, you are perfect. Got my weekend.
Mario
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
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.
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)?
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.
The zip file is corrupt and I can’t install it. (unexpected end of archive).
@G Crolla works fine here, please try downloading again.
New version uploaded, bug was found, AddMailingActionEvent caused content and media picker to stop working.
This is now resolved.
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
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
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
@Jeff, it’s not the umbraco library but it’s the mail engine library that has the method.
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?
@JC did you install it on a v4.0.1 site ?
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
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
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
What about smtp authentication? (host, user, pass)
It is a must to support it.
@Lefteris, sure that shouldn’t be a problem since the mailer uses the settings from the system.net mailSettings in the web.config
Nice work, however I get an error, Failed to send mail.
Is there something with smtp ?
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
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
meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″
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
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.
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.
Tim just to emphasize and to show that it is not all bad then I love your emailengine!
Regards,
Scott
Thanks a million. Great package and a total life saver
Tim,
can you please fix the UTF8 issue and publish again the package?
Thank you.
Any source code? Where?
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?)
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.
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?
Tim are you still here?
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
Perfect Tim - thank you.
Thanks for the great info
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!
I agree with Simon!
Great work for sure.
Thanks Tim.
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.
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