Beispiel #1
0
        public void ClientConfigurationWithCertificate()
        {
            // The actual sender of the message. The broker is the owner of the organization certificate
            // used in the library. The broker id can be retrieved from your Digipost organization account.
            var broker = new Broker(12345);

            // The sender is what the receiver of the message sees as the sender of the message.
            // Sender and broker id will both be your organization's id if you are sending on behalf of yourself.
            var sender = new Sender(67890);

            var clientConfig = new ClientConfig(broker, Environment.Production);

            var client = new DigipostClient(clientConfig, CertificateReader.ReadCertificate());
        }
Beispiel #2
0
        public void SendOnBehalfOfOrganization()
        {
            var broker = new Broker(12345);
            var sender = new Sender(67890);

            var digitalRecipient = new RecipientById(IdentificationType.PersonalIdentificationNumber, "311084xxxx");
            var primaryDocument  = new Document(subject: "Attachment", fileType: "txt", path: @"c:\...\document.txt");

            var clientConfig = new ClientConfig(broker, Environment.Production);

            var message = new Message(sender, digitalRecipient, primaryDocument);

            var result = client.SendMessage(message);
        }