Ahh - so simple. Thank you superdoc.

I now have a working script. Unfortunately couldn't use TFMal because I don't have permission for sendmail. I ended up with the following. Probably a bit clunky but it works.

#! /usr/bin/perlml use Mail::Sendmail; use CGI; @values=(); &parse; &send; &thanks; sub parse { my $q = new CGI; my $data = $q->param('POSTDATA'); @values = split (/[\s=]+/, $data); } sub send { $mail{'smtp'} = "smtp.###.co.za"; $mail{'port'} = 465; $mail{'auth'} = {user => '###@###.co.za', password => '###'}; %mail = ( To => '###@###.co.za', From => "@values[3]", Message => "@values[1]\n\n@values[5]" ); sendmail(%mail) or die $Mail::Sendmail::error; } sub thanks { print "Content-type: text/html \n\n"; print <<END; <html> <head> <title>Thank you for your message</title> <meta http-equiv="Content-Type" content="text/html; c +harset=utf-8" /> <meta http-equiv="Content-Language" content="en" /> <link rel="stylesheet" type="text/css" href="/css/gen +eral.css" /> <link rel="stylesheet" type="text/css" href="/css/tha +nks.css" /> </head> <body> <div id="header"> <img id="small-logo" alt="### Logo" src="/graphic +s/LogoSmall.jpg" height="80" width="80" /> <div id="nav"> <ul> <li><a href="/index.html">home</a></li> <li><a href="/about.html">about us</a></l +i> <li><a href="/products.html">products</a> +</li> <li><a href="/customers.html">customers</ +a></li> <li><a href="/gallery.html">gallery</a></ +li> <li><a href="/contact.html">contact us</a +></li> </ul> </div> </div> <div id="content"> <h1>Thank you for leaving a message</h1> <p>We will respond as soon as possible.</p> </div> </body> </html> END }

In reply to Re^5: Not getting form data from stdin (nms-cgi) by trewornan
in thread Not getting form data from stdin by trewornan

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.