<!--
 -  
 -  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
 -  project.
 -  
 -  Copyright (C) 1998-2018 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
 -  
 -  
-->
<?xml version="1.0" encoding="ISO-8859-1"?>
<refentry id="SM-S-4">
  <refmeta>
    <refentrytitle>SMTP SOAP processing</refentrytitle>
    <refmiscinfo>tutorial</refmiscinfo>
  </refmeta>
  <refnamediv>
    <refname>Mail notification</refname>
    <refpurpose>Automatic reply to mail message</refpurpose>
  </refnamediv>

<refsect1 id="SM-S-4a">
<title>Example</title>
<itemizedlist mark="bullet">
  <listitem>The example shows an automatic reply to the sender.</listitem>
  <listitem>If the message contains a valid XML structure describing the order SOAP request,
  it will add the order to the demo tables and reply with a success message.</listitem>
  <listitem>If there is no valid structure, it will reply with a failure notice.</listitem>
  <listitem>The web page contains configuration instructions.</listitem>
  <listitem>It is possible to define the mail account on the server for processing these messages.</listitem>
</itemizedlist>
<para>An example SMTP send command is :</para>
<programlisting>
<![CDATA[
smtp_send (
  null,
  'imitko@localhost',
  'dav@localhost' ,
  'Subject: SOAPMethodName: #new_order\r\n\r\n
  <?xml version=\'1.0\' ?>
  <SOAP:Envelope
    xmlns:xsi=\'http://www.w3.org/1999/XMLSchema-instance\'
    xmlns:xsd=\'http://www.w3.org/1999/XMLSchema\'
    xmlns:SOAP=\'urn:schemas-xmlsoap-org:soap.v1\'
    xmlns:dt=\'urn:schemas-microsoft-com:datatypes\'>
      <SOAP:Body>
        <new_order>
          <_CustomerID>CENTC</_CustomerID>
          <_EmployeeID>1</_EmployeeID>
          <_ShipVia>3</_ShipVia>
          <_RequiredDate>2001-05-31</_RequiredDate>
          <_ProductID>26</_ProductID>
          <_Quantity>1</_Quantity>
          <_Discount>0.300000</_Discount>
        </new_order>
      </SOAP:Body>
  </SOAP:Envelope>'
);
]]>
</programlisting>
</refsect1>
</refentry>
