Hi Monks Here is again same problem, this time I gettig the following message: Invalid argument at Z:/Program Files/Apache Group/Perl/site/lib/Mail/Mailer.pm l ine 266. Code I am using is as follow:
#!c:/program files/apache group/perl/bin/perl.exe -w use CGI; use strict; use warnings; use Mail::Mailer; my $YourEmail = 'mymail@mymail.com'; my $referers = ('abc111'); # Location of mail program - check your doc or ask admin my $MailProgram = 'C:/Program Files/Apache Group/Perl/site/lib/Mail/Ma +iler/sendmail'; # Subject of the e-mail autoreply to the submitter my $Subject = "Thanks for Your Message!"; # Header line in the auto-reply message my $Header = "GOOBERS UNLIMITED"; # Brief tail message for body of e-mail autoreply my $TailMessage = "If your message requires a reply, we'll get back to + you soon."; # Your signature lines the end of the autoreply e-mail ##### END OF SETTABLE VARIABLES ############################ ##### MAIN PROGRAM ######################################### my $query = new CGI; my $sirName = $query ->param("sirName"); my $firstName = $query ->param("firstName"); my $Email = $query ->param("email"); my $Add1 = $query ->param("add1"); my $Add2 = $query ->param("add2"); my $City = $query ->param("city"); my $County = $query ->param("county"); my $Postcode = $query ->param("postcode"); my $Message = $query ->param("Message"); my $mailer = new Mail::Mailer 'smtp', Server => 111.11.1.111; my %headers = ('To' => '$YourEmail', 'From' => '$Email'); my $body = '$Message'; $mailer->open(\%headers); print $mailer $body; ## print $smtp $message; $mailer->close(); ##print "Content-type: text/html\n\n"; exit;
following is the sub rutin of Mailer.pm where erroe is coming.
sub open { my($self, $hdrs) = @_; my $exe = *$self->{Exe}; # || Carp::croak "$self->open: bad exe"; my $args = *$self->{Args}; _cleanup_hdrs($hdrs); my @to = $self->who_to($hdrs); $self->close; # Fork and start a mailer (defined($exe) && open($self,"|-"))=======> Error is coming on thi +s line || $self->exec($exe, $args, \@to) || die $!; # Set the headers $self->set_headers($hdrs); # return self (a FileHandle) ready to accept the body $self; } sub _cleanup_hdrs { my $hdrs = shift; my $h; foreach $h (values %$hdrs) { foreach (ref($h) ? @{$h} : $h) { s/\n\s*/ /g; s/\s+$//; } } }
Hope this time my problem will resolve Its giving the same error again

Considered: holli: followup. reparent under Mail::Mailer on NT
Unconsidered: ysth: not the same question; many keep votes - Keep/Edit/Delete: 7/27/1


In reply to mailing problem by perlTech

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.