#!/usr/bin/perl


use HTTP::Request::Common qw(POST);
use Mail::Sendmail;
use CGI qw(param);

$ta=param('ta') ;
$send=param('send');

$email="korolev-ia\@yandex.ru";
$fromd="wordpress\@unixpin.com";
$from=$from;
$smtp="localhost";
$subj="Check ovpn";

$mail{'Smtp'}	=$smtp;
$mail{'From'}	=$fromd;
$mail{'Content-Type:'}='text/plain; charset=utf-8';
$mail{'Subject'}=$subj;
$mail{'To'}=$email;
$mail{'Message'}="$ta";


print "Content-type: text/plain\n\n";

if ( $send ) {
	if ( sendmail(%mail) ) {
		$outstr.="Thank for your message. We send email to admin." ;
	} else {
		 $outstr.="Can't send mail to $mail{'To'} :".Sendmail::error;
	}
}
print $outstr;


