use strict; use warnings; use Mail::Sendmail; my %mail = ( To => 'Bakkiaraj Murugesan ', From => 'Bakkiaraj Murugesan ', #Bcc => 'Someone , Someone else her@there.com', # only addresses are extracted from Bcc, real names disregarded #Cc => 'Yet someone else ', # Cc will appear in the header. (Bcc will not) Subject => 'Test message - Bakki', 'X-Mailer' => "Mail::Sendmail version $Mail::Sendmail::VERSION", ); $mail{Smtp} = '.'; # $mail{'X-custom'} = 'My custom additionnal header'; $mail{'message : '} = "Test Message"; # cheat on the date: $mail{Date} = Mail::Sendmail::time_to_date( time() ); if (sendmail(%mail)) { print "Mail sent OK.\n" } else { print "Error sending mail: $Mail::Sendmail::error \n" } print "\n\$Mail::Sendmail::log says:\n", $Mail::Sendmail::log;