When you pass a hash to a function, this "flattens out" as a sequence of key, value. No need to worry, follow the below formula:
### Create a new multipart message:
$msg = MIME::Lite->new
(
From => 'me@myhost.com',
To => 'you@yourhost.com',
Cc => 'some@other.com, some@more.com',
Subject => 'A message with 2 parts...',
Type => 'multipart/mixed'
);
### use Net:SMTP to do the sending
$msg->send('smtp','some.host', Debug=>1 );
Same as:
$msg->send('smtp' => 'some.host',
'Debug' => 1
);
you were passing a reference to a hash instead of the actual hash which is key value pairs.
Update: Ooops. What Wind has written is correct. I missed that you were passing a hash ref to a very, very thin layer. My bad. |