D
Dan
Ahoy all,
The following is a simplified extract of some code i'm knocking
together...
$attachmenthash->{'smily.gif'} = {'smily.gif' => { 'ctype' =>
'image/gif', 'file' => '/foo/bar/smiley.gif' }};
$attachmenthash->{'printtest.xls'} = {'printtest.xls' => { 'ctype' =>
'application/octet-stream', 'file' => '/foo/bar/printtest.xls' }};
email({
'from' => $from,
'to' => $to,
'cc' => $cc,
'bcc' => $bcc,
'subject' => $subject,
'priority' => 3, # 1-5 high to low
'smtp' => 'smtp.yadayadayada.com',
'port' => 25,
'auth' => 'LOGIN',
'authid' => 'yadayada',
'authpwd' => 'yada',
'_text' => $email,
'_attachments' => %attachmenthash,
}) or die "email() failed: $@";
.... the code should create an email with the two attachments. In the
real world, the number of attachments would depend on variables passed
by the user. The email sends fine, but no attachments are included.
Please help, i've not done much with hashes of hashes before, and this
is driving me nuts.
Any advice appreciated.
Dan
The following is a simplified extract of some code i'm knocking
together...
$attachmenthash->{'smily.gif'} = {'smily.gif' => { 'ctype' =>
'image/gif', 'file' => '/foo/bar/smiley.gif' }};
$attachmenthash->{'printtest.xls'} = {'printtest.xls' => { 'ctype' =>
'application/octet-stream', 'file' => '/foo/bar/printtest.xls' }};
email({
'from' => $from,
'to' => $to,
'cc' => $cc,
'bcc' => $bcc,
'subject' => $subject,
'priority' => 3, # 1-5 high to low
'smtp' => 'smtp.yadayadayada.com',
'port' => 25,
'auth' => 'LOGIN',
'authid' => 'yadayada',
'authpwd' => 'yada',
'_text' => $email,
'_attachments' => %attachmenthash,
}) or die "email() failed: $@";
.... the code should create an email with the two attachments. In the
real world, the number of attachments would depend on variables passed
by the user. The email sends fine, but no attachments are included.
Please help, i've not done much with hashes of hashes before, and this
is driving me nuts.
Any advice appreciated.
Dan