Recently, I installed the sendemail program on my Ubuntu server. When I tried to send an email over SMTP, I encountered an error that Net::SSLeay and IO::Socket::SSL Perl modules are missing on system.

To resolve this issue, I needed to install the Net::SSLeay and IO::Socket::SSL Perl modules on my Ubuntu 22.04 server. Here’s how you can do it:

  1. Update the package list:
    sudo apt update
    
  2. Install the required dependencies:
    sudo apt install libssl-dev
    
  3. Install Net::SSLeay and IO::Socket::SSL using CPAN:
    sudo apt install cpanminus
    sudo cpanm Net::SSLeay IO::Socket::SSL
    

Alternatively, you can use the system’s package manager to install these modules if available:

  1. Install libio-socket-ssl-perl (which includes both Net::SSLeay and IO::Socket::SSL):
    sudo apt install libio-socket-ssl-perl
    

After installing these modules, the sendemail program should be able to send emails over SMTP without encountering the SSL error.