in reply to Issue with 2 attachments in email using perl sendmail
I tried to look on various forums and everywhere i get advice using MIME :: Lite. Unfortunately i cannot use it.
Care to tell why? Since you are able to use MIME::Base64 and MIME::QuotedPrint it should not be too difficult to include a use MIME::Lite in there.
If you get the advice to use MIME::Lite everywhere, why should that be different here?
please help me in debugging above code.
Please go over your post again and enclose the above code within <code> tags. If you want help, help us to help by making your posting readable. See Writeup Formatting Tips for details, and use the preview button.
That said, there are several errors (uncomplete list):
That should be:$mail{body} += encode_base64(<IN>); # addition won't work
or if you want to append:$mail{body} = encode_base64(<IN>); # just assign it
See perlop.$mail{body} .= encode_base64(<IN>); # just assign it
$mail{body} = <<EOD; <--- delimiter ... $mail{body} --$boundary Content-Type: application/vnd.ms-excel; name="$file3" Content-Disposition: attachment; filename="$file3" Content-Transfer-Encoding: base64 Content-Length: $len $mail{body} $boundary-- END_OF_BODY <-- wrong delimiter
Fix that, and add use strict; use warnings; at the top of your script! That will make perl tell you about blatant errors, so we don't have to.
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Issue with 2 attachments in email using perl sendmail
by Anonymous Monk on Jul 20, 2008 at 22:28 UTC | |
by jfroebe (Parson) on Jul 21, 2008 at 02:34 UTC |