To reduce the packets captured to just those that are interesting you need a capture filter. http://wiki.wireshark.org/CaptureFilters has a good explanation; what you want is something like
host smtp.gmail.com and port 25 (or 587, 465, etc.)
Since MIME::Lite->send isn't cutting it, why not use Net::SMTP::TLS directly? Something like:
sub make_and_send_email{
my ($from, $to,$subject,$message, $path) =@_;
use Net::SMTP::TLS;
my $un='myun';
my $pw='mypwd';
my $mh='smtp.gmail.com';
my $pt=25; # or 587, 465, etc depending on what gmail uses
my $mailer = new Net::SMTP::TLS(
$mh,
Port => $pt,
User => $un,
Password => $pw,
Timeout => 60,
) or die "Cannot create a TLS mailer instance!\n";
$mailer->mail($from);
$mailer->to($to);
$mailer->data();
my $msg = MIME::Lite->new(
From => $from,
'Reply-to' => $from,
To => $to,
Subject => $subject,
Type => 'multipart/related'
) or die "Cannot create a new email instance!\n";
$msg->attach(
Type => 'TEXT',
Data => $message,
) or die "Error adding TXT: $!\n";
$msg->attach(
Type => 'aplication/pdf',
Path => $path,
Disposition => 'attachment'
) or die "Error adding PDF: $!\n";
$mailer->datasend($msg->as_string);
$mailer->dataend();
$mailer->quit();
}
|