Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By bhatmahesht on
I'm able to send mail using drupal_mail with the following code
drupal_mail('custom_module', 'custom_key', $email, language_default(), $params,'from@email.com');
My hook mail is written like this
function custom_module_mail($key, &$message, $params) {
$feedback = $params['result_id']; // feedback contains HTML elements
switch ($key) {
case 'custom_key':
$message['subject'] = 'Your feedback on the survey ';
$message['body'][] = $feedback;
break;
}
However when I try to open the message in my inbox it is not showing email body, but it is showing the email is unencrypted with the icon. Also when I look at the mail details, it points to learn more with following https://support.google.com/mail/answer/6330403?visit_id=1-63621632940261...
How can I ensure that mail I have sent is encrypted?
Comments
You need to send your mail as
You need to send your mail as an authenticated mail, and use either TLS or... I can't think of the other encryption name right now. If you send mail using port 25 or 26, it is not encrypted.
The SMTP module is good for this, it allows you to configure your mail connection.
gpg mail
The nature of a GPG/PGP mime mail message should be transparent to the mail system itself.
It should just be a block of message body text to the SMTP system.
Your custom module would need to use GNU GPG code to construct the mail message and then insert the encrypted mail body into the message being constructed.
Of course, constructing a PGP/GPG mime message means your system needs to provide a private sender key and one or more public recipient keys during message build time.
If you get this figured out, it would make a great generalized module for the entire Drupal universe.
A PGP/GPG message body looks like the following to the SMTP transport:
spritefully yours
Technical assistance provided to the Drupal community on my own time ...
Thank yous appreciated ...
There is a Module PGP_Contact
It makes use of the core drupal contact form an is rather limited and a bit outdated but the principles still work:
https://www.drupal.org/project/pgp_contact
Further there is Webform_Encrypt which extends Webform by encryption https://www.drupal.org/project/webform_encrypt
Both could be a starting point.
If you want client side encryption you should follow the pgp_contact way.