Try our conversational search powered by Generative AI!

Sending EPiServer Mail Programatically



Ok so we need to be able to send emails programatically and not through the EPiServer editor. We currently have a scheduler in our legacy system that runs, picks out users from the database, builds the emails and send them to the users. We however want to have more tracking around emails and therefore as we are currently in the process of moving the site to EPiServer we think EPiServer mail could be an option.

So I'm thinking we can create custom RecipientSource with Recipients from our database and using our stored procedures. We could also use the EPiServer scheduler to do the Scheduling and we could build the emails are selves as we currently are doing. My only issue is can we actually build the OrderMail email and send this to EPiServer mail servers programatically from the scheduler custom task we will be writing?

Has anyone done this before? Are there are caveats? If we are sending an order email to the EPiServer mail servers how do we ensure security? i.e. how do they know the email is genuine (the sender email address), and is the email encytped at all? PGP?

Thanks for any help in advance,


Feb 09, 2012 7:35

I don't even think you have to dig around building your own order mail. Just construct a Message instance and call the EPiServerMail.Send method.

If that doesn't work I think there's a way to build your own custom order mail. The authentication is handled by using the crypto keys in the config, look at EPiServerMailFactory.SendOrderMail how it users the EPiServerMailSettings crypto services.

Feb 09, 2012 8:25
This thread is locked and should be used for reference only. Please use the Legacy add-ons forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.