To send emails to other SAFE Network users, you need to know their email ID.
First, the app retrieves the encryption key associated with the appendable data that belongs to the recipient. Then, it encrypts the email using that encryption key and saves it as immutable data. Finally, it appends the immutable data that represents the email to the appendable data of the recipient.
Contents
Compose Mail page
The JSON data for the above email would look like this:
Get the appendable data of the recipient
Before fetching the encryption key of the recipient, the app needs to obtain an appendable data handle.
Get a data identifier handle
First, the app fetches a data identifier handle for the appendable data of the recipient.
After the appendable data handle is successfully obtained, the app fetches an handle for the public encryption key of the recipient. By encrypting your email using that encryption key, only the recipient will be able to read it. This is known as asymmetric encryption.
The app encrypts the data map of the email using the cipher handle that contains the encryption key handle of the recipient. The data map is stored as immutable data on the SAFE Network.