Developer forum

Forum » Development » Encrypted email

Encrypted email

Rasmus Andersen
Reply

Hi Dynamciweb,

Using FormMailer (/Admin/Public/FormMailer.aspx) is it possible to send an encrypted email. I am aware it is not possible through HostNordic but changing SMTP, is this be possible?

Best regards
 


Replies

 
Nicolai Høeg Pedersen
Reply

No, that is not possible.

FormMailer.aspx is dead by the way on new 8 solutions.

BR Nicolai

 
Rasmus Andersen
Reply

Hi again Nicolai, 

Yep I thought so, what will it require to make "Forms for editors" support end-to-end encrypted emails.
How can it be extended and how can I omit one field from being stored in the database. 

 
Nicolai Høeg Pedersen
Reply

Hi Rasmus

In forms for editors you have 2 notifications that you can use, Dynamicweb.Modules.Forms.Notifications.Frontend.OnSendMail and Dynamicweb.Modules.Forms.Notifications.Frontend.OnSendReceipt (depending on which of the mails you want to encrypt, my guess is OnSendMail which goes tot he website owner.

That notification will give you a Notifications.Frontend.OnSendMailArgs instance and on that one of the properties is called EmailMessage and is the System.Net.Mail.MailMessage that is about to be send. So you can encrypt that one using a certificate - that you have to Google, here is an exanple: http://www.diaryofaninja.com/blog/2009/10/02/sending-encrypted-email-with-c. Just add the encryption and DW will send the mail off as usual.

The OnSendMailArgs instance also contains a property called "Submit" that contains the data that the user submmitted and has been saved already. Run through that and encrypt or delete the data:

foreach (SubmitData sd in s.FieldValues) {
    if (sd.Field.SystemName == "cpr") {
        sd.Value = "******";
        sd.Save();
        break;
    }
}

BR Nicolai

 

You must be logged in to post in the forum