Giter Site home page Giter Site logo

dkim.net's Introduction

DKIM.Net

DomainKeys Identified Mail (DKIM) and Domain Key email signing for .Net Framework

Known Issues

As System.Net.Mail.SmtpClient generates boundary identifiers randomly and as this code hacks the SmtpClient to retrieve the full email content before sending the code cannot be used when sending with SmtpClient and the MailMessage when the MailMessage has an alternative view or an attachment.

Example - Sending with SmtpClient

	var msg = new MailMessage();

	msg.From = new MailAddress("[email protected]", "Joe Bloggs");
	msg.To.Add(new MailAddress("[email protected]", "Port25"));
	msg.Subject = "Testing DKIM.Net";
	msg.Body = "Hello World";
	
	
	
	
	var privateKey = PrivateKeySigner.Create(@"-----BEGIN RSA PRIVATE KEY-----
	....
	-----END RSA PRIVATE KEY-----");
	


	var domainKeySigner = new DomainKeySigner(privateKey, "mydomain.com", "abc", new string[] { "From", "To", "Subject" });
	msg.DomainKeySign(domainKeySigner);


	var dkimSigner = new DkimSigner(privateKey, "mydomain.com", "abc", new string[] { "From", "To", "Subject" });
	msg.DkimSign(dkimSigner);

	new SmtpClient().Send(msg);

Example - DNS Records

Domain Key settings

_domainkey "o=~;[email protected]"

Domain Key / DKIM selector

selector._domainkey "k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDetWmczoNly/wfDc5WH8F2o42kGjYG7bbmfxjNP2y2qZja84v5W8z8SL702w3N5ZwQLdQmuQ8yN4WOYrg8DHGOB6g+xVP3h1Hr1+C05Vk/x3BXw0wIffNqcVzPkRNNNILtiwPJhhlDVMvaTx20vrrCAz9i6CX6Onj4OWxUaAjtuQIDAQAB"

dkim.net's People

Contributors

dmcgiv avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.