in reply to Re: Re: Sending mail on a Win32 platform
in thread Sending mail on a Win32 platform

Hi, according to the Mail::Mailer docs, you need to pass a hashref with the headers, you're passing a hash. Try this:
$mailer->open({ ( To => ['mindaugas@elinara.ktu.lt'], Cc => ['mindaugas@elinara.ktu.lt'], From => 'mindaugas@elinara.ktu.lt', Subject => 'Some test mail' ) } );
Does that work?

CU
Robartes-

Replies are listed 'Best First'.
Re: Re^3: Sending mail on a Win32 platform
by samspade (Novice) on Feb 25, 2003 at 11:10 UTC
    here is a file that i created with a few examples using Mail::Sendmail and Mail::Sender. Overall Mail::Sender is more useful allowing attachments to be sent.Hope this helps.
    Sean

    use Mail::Sendmail; #originally investigated--does not allow for incor +poration of attachments use Mail::Sender;#better allows single attachments + multiple attachme +nts use CGI; use CGI::Carp qw(fatalsToBrowser warningsToBrowser); ###Sending simple message Mail::Sendmail module ####################################################### print $R::imp_email; print "hello"; %mail = ( To => 'bill.bragg@indiq.net', From => $R::imp_email, Message => "This is a very short message" ); $rc=sendmail(%mail);#1 on success, 0 on error if (!($rc)) { print $Mail::Sendmail::error; } print "OK. Log says:\n", $Mail::Sendmail::log; #Simple message--Mail::Sender module eval{ $sender = new Mail::Sender {smtp => 'mail1.eircom.net', from => $R::imp_email}; $sender->MailMsg({to => 'bill.bragg@eircom.net', subject => 'Test of Mail Sender Module', msg => "Test of Mail Sender Module"}); if ($Mail::Sender::Error) { print "<B>$Mail::Sender::Error --Please Report This Error< +/B>\n"; print "Also please contact $R::imp_email by phone and tell him/her that a cancel request has been issued for this line\n"; exit; } }; #Adding attachment to mail--Mail::Sender module eval{ $sender = new Mail::Sender {smtp => 'mail1.eircom.net', from => $R::imp_email}; $sender->MailFile({to => 'sean.mccoubrey@eircom.net', subject => 'Test of Mail Sender Module', msg => "Test of Mail Sender Module", file => 'C:\InetPub\scripts\Paris\filxname.txt'}); if ($Mail::Sender::Error) { print "<B>$Mail::Sender::Error -- Please Report This Error +</B>\n"; print "Also please contact $R::imp_email by phone and tell + him/her that a cancel request has been issued for this line\n"; exit; } }; #A different way to add html attachment, Can specify more than one fil +e by comma separating them $sender = new Mail::Sender{smtp => 'mail1.eircom.net', from => $R::imp +_email}; (ref ($sender->MailFile( {to =>'tom.thumb@isp.net', subject => 'this is a test', msg => "Hi Johnie.\nI'm sending you the pictures you wanted.", file => 'C:\InetPub\scripts\Paris\index.html' })) and print "Mail sent OK." ) or die "$Mail::Sender::Error\n"; if ($Mail::Sender::Error) { print "<B>$Mail::Sender::Error --Please Report This Error</B>\n"; print "Also please contact $R::imp_email by phone and tell him/her + that a cancel request has been issued for this line\n"; exit; }

    update (broquaint): added <code> tags and removed excessive whitespace

Re: Re^3: Sending mail on a Win32 platform
by Heidegger (Hermit) on Feb 25, 2003 at 08:26 UTC
    Yes, thank you - that works. Here's the example code from The Perl Journal that was passing a hash to this routine and made me perplexed.