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


In reply to Re: Re^3: Sending mail on a Win32 platform by samspade
in thread Sending mail on a Win32 platform by Heidegger

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.