@larissa
Here is an example of how to send an email using the Net::SMTP module in Perl:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
use Net::SMTP; my $smtp = Net::SMTP->new('mail.example.com', Timeout => 30) or die "Failed to connect to SMTP server"; $smtp->mail('sender@example.com'); $smtp->to('recipient@example.com'); $smtp->data(); $smtp->datasend("From: sender@example.com "); $smtp->datasend("To: recipient@example.com "); $smtp->datasend("Subject: Test Email "); $smtp->datasend(" "); $smtp->datasend("This is a test email sent using Net::SMTP in Perl. "); $smtp->dataend(); $smtp->quit; |
Make sure to replace 'mail.example.com', 'sender@example.com' and 'recipient@example.com' with the appropriate values for your SMTP server and email addresses.