Need to trace the output of Mime::Lite module (HELP)

K

kenhensleys

I have this simple Mime::Lite script quoted below.
It works alright.
But I would like to trace the result of the output.
Something like
set -x in ksh
or anything else similar.
Or some logging?
What should I do and where should I put it?







......................




#!/usr/bin/perl

use MIME::Lite;
use Net::SMTP;

my $from_address = (e-mail address removed)';
my $to_address = '(e-mail address removed)';
my $mail_host = 'mailhost.domain.com';

### Adjust subject and body message
my $subject = 'A message with 2 parts ...';
my $message_body = "Here's the attachment file(s) you wanted";

### Create the multipart container
$msg = MIME::Lite->new (
From => $from_address,
To => $to_address,
Subject => $subject,
Type =>'multipart/mixed'
) or die "Error creating multipart container: $!\n";

### Add the text message part
$msg->attach (
Type => 'TEXT',
Data => $message_body
) or die "Error adding the text message part: $!\n";

### Add the ZIP file
$msg->attach (
Type => 'application/zip',
Path => $my_file_zip,
Filename => $your_file_zip,
Disposition => 'attachment'
) or die "Error adding $file_zip: $!\n";
### Send the Message
MIME::Lite->send('smtp', $mail_host, Timeout=>60);
$msg->send;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,190
Latest member
ClayE7480

Latest Threads

Top