Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
Create Signed + Encrypted EMLDownloads for Windows/Linux and Install Instructions Ruby script to create an email that is both signed and encrypted. # file: CreateSignedEncryptedEml.rb require 'rubygems' require 'chilkat' # How to create a .eml file that is both digitally signed and encrypted. mailman = Chilkat::CkMailMan.new() mailman.UnlockComponent("anything for 30-day trial") # Create a simple email email = Chilkat::CkEmail.new() email.put_Subject("Signed + encrypted email in Ruby") email.put_Body("Signed + encrypted email in Ruby") email.put_From("Chilkat Support <support@chilkatsoft.com>") email.AddTo("John","john@example.com") # Simply indicate that the email is to be signed AND encrypted: email.put_SendEncrypted(true) email.put_SendSigned(true) mimeStr = Chilkat::CkString.new() # The RenderToMime method renders the email according to the property settings # of the email and mailman objects. success = mailman.RenderToMime(email,mimeStr) if not success mailman.SaveLastError("lastError.xml") else # Convert line endings from CRLF to bare LF's mimeStr.toLF() # Save the MIME string to a file. aFile = File.new("secure_email.eml", "w") aFile.write(mimeStr.getString()) aFile.close end |
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.