#!/usr/bin/perl
use strict;
use warnings;
use MIME::Lite::TT::HTML;
email ('agnello','agnello.dsouza@gmail.com');
sub email {
my ( $recruiter_name, $to ) = @_;
my %options;
$options{INCLUDE_PATH} = '/scripts';
my %params;
$params{recruiter_name} = $recruiter_name ;
my $msg = MIME::Lite::TT::HTML->new(
From => 'agnello.dsouza@gmail.com' ,
To => $to,
Subject => 'Some subject ',
Template => {
html => 'resume.tt',
text => 'text.resume.tt',
},
TmplOptions => \%options,
TmplParams => \%params,
);
# Set our content type properly
$msg->attr("content-type" => "multipart/mixed");
# Attach a PDF to the message
$msg->attach( Type => 'application/pdf',
Path => '/scripts',
Filename => 'Agnello_dsouza.pdf',
Disposition => 'attachment'
);
# $msg->send('smtp', "smtp.gmail.com", SSL=>1, AuthUser=>'agnello.dsouza.linux@gmail.com', AuthPass=>'xxxxxxxxxx', Debug=>1);
$msg->send();
}
No comments:
Post a Comment