in reply to Re: nntp posting (Moved from Q&A)
in thread nntp posting (Moved from Q&A)

#!/usr/bin/perl -w use News::NNTPClient; use MIME::Lite; $msg = MIME::Lite->new( To =>'news.directlink.net', Subject =>'HTML with in-line images!', Type =>'multipart/related' ); $msg->attach(Type => 'text/html', Data => qq{ <body> Here's <i>my</i> image: <img src="cid:myimage.gif"> </body> } ); $msg->attach(Type => 'image/gif', Id => 'myimage.gif', Path => '/usr/X11R6/share/IglooFTP/html/images +/viglooftp.gif', ); $c = new News::NNTPClient("news.bleh.com"); if ($c->postok()) { @header = ("Newsgroups: testing", "Subject: he234llo123", "From: test\ +@test.org"); @body = ("$msg"); $c->post(@header, "", @body); } __END__
can't figure out what i'm doing wrong the posted output end sup a MIME::Lite=hashblehbleh

Replies are listed 'Best First'.
RE: RE: Re: nntp posting (Moved from Q&A)
by Fastolfe (Vicar) on Oct 30, 2000 at 19:50 UTC
    You can't "stringify" a MIME::Lite object by simply referring to it in a string context. Your relevant line of code needs to be changed slightly:
    $body = $msg->as_string;
    Or use @body, whatever. Your post could also use some <code> tags, but I guess you can't fix it if you're not logged in.