#!/usr/bin/perl use strict; use warnings; use Mail::Sendmail; my %mail; $mail{Smtp} = "smtp.gmail.com"; $mail{Debug} = 6; $mail{Port} = 465; $mail{Auth} = {user => "username", pass => "password", method => "LOGIN", required => 1}; # set the recipients (to) address [REQUIRED] $mail{To} = 'xxxxxxx@gmail.com'; # set the mail sender address [REQUIRED] $mail{From} = 'xxxxxxx@gmail.com'; $mail{Sender} = 'xxxxxxx@gmail.com'; # set the mail subject line $mail{subject} = "Test message"; # set the mail content $mail{body} = "The test messsage is having this body line inside."; # set the mail encoding type $mail{'content-type'} = qq(text/plain; charset="utf-8");