<?vsp 
--  
--  $Id: sm_s_1_sample_1.vsp,v 1.2.2.1 2012/03/08 12:55:13 source Exp $
--  
--  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
--  project.
--  
--  Copyright (C) 1998-2012 OpenLink Software
--  
--  This project is free software; you can redistribute it and/or modify it
--  under the terms of the GNU General Public License as published by the
--  Free Software Foundation; only version 2 of the License, dated June 1991.
--  
--  This program is distributed in the hope that it will be useful, but
--  WITHOUT ANY WARRANTY; without even the implied warranty of
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
--  General Public License for more details.
--  
--  You should have received a copy of the GNU General Public License along
--  with this program; if not, write to the Free Software Foundation, Inc.,
--  51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--  
--  

  declare err varchar;
  err := '';
  if ({?'exec'} = 'Send')
    {
      declare exit handler for sqlstate '*' { err := __SQL_MESSAGE; };
	{
	  smtp_send ({?'ms'}, {?'se'}, {?'re'}, {?'txt'});
          err := 'Message successfully sent';
	}
    }
?>

<html>
    <HEAD><link rel="stylesheet" type="text/css" href="../demo.css" /></HEAD>
 <body>
  <p><?=err?></p>
  <form method="post" action="sm_s_1_sample_1.vsp">
   <table class="tableentry">
     <tr><td>1. Enter the Mail server</td><td><input type="text" name="ms" value=""></td></tr>
     <tr><td>2. Enter the Sender email</td><td><input type="text" name="se" value=""></td></tr>
     <tr><td>3. Enter the Recipient email</td><td><input type="text" name="re" value=""></td></tr>
     <tr><td>4. Enter the Message text</td><td><textarea name="txt" rows=10 cols=50></textarea></td></tr>
     <tr><td>5. Send message</td><td><input type="submit" name="exec" value="Send"></td><td></td></tr>
   </table>
  </form>
 </body>
</html>
