Multipurpose Send Mail Form Builder

v2.0

 

Examples

Example4: Send a copy of mail to customer

We can create following form:

we want that when customer check "Send mail to this email too" so mail will be sent to his/her address too.

And here is content of XML file we need

<?xml version="1.0"?>
<configuration>
   <sendmailPHP>http://jomtube.net/sendmail/sendmail/mail_sender.php</sendmailPHP>
   <form>
      <backgroundColor>#D4E1D0</backgroundColor>
      <borderDisplay>false</borderDisplay>
      <width>563</width>
      <height>548</height>
      </form>
      <sendButton>
      <x>400</x>
      <y>50</y>
      <width>150</width>
      <height>50</height>
      <backgroundColor>#D9D55E</backgroundColor>
      <textColor>Yellow</textColor>
      <caption>Submit</caption>
      <toolTip>Press when you are ready to send</toolTip>
   </sendButton>
   <resetButton>
      <x>156</x>
      <y>1460</y>
      <width>100</width>
      <height>30</height>
      <backgroundColor>red, haloOrange</backgroundColor>
      <visible>false</visible>
      <textColor>green</textColor>
      <caption>Clear</caption>
      <toolTip>Clear all text</toolTip>
   </resetButton>
</configuration>
<objectlist>
   <!-- Title - Your contact information -->
   <object>
      <type>Label</type>
      <name>lblTitleContactInformation</name>
      <x>10</x>
      <y>10</y>
      <width>400</width>
      <height>20</height>
      <require>false</require>
      <value>Your Contact Information</value>
      <font>
         <name>Arial</name>
         <size>17</size>
         <bold>true</bold>
         <color>#815bee</color>
      </font>
   </object>
   <object>
      <type>Label</type>
      <name>lblYourName</name>
      <x>10</x>
      <y>50</y>
      <width>430</width>
      <height>20</height>
      <font>
         <bold>true</bold>
      </font>
      <value>Your Name</value>
   </object>
   <object>
      <type>Label</type>
      <name>lblYourEmail</name>
      <x>10</x>
      <y>80</y>
      <width>430</width>
      <height>20</height>
      <require>true</require>
      <font>
         <bold>true</bold>
      </font>
      <value>Your Email</value>
   </object>

   <object>
      <type>TextInput</type>
      <name>txtYourName</name>
      <x>150</x>
      <y>50</y>
      <width>200</width>
      <height>20</height>
      <value></value>
      <includeChars></includeChars>
      <excludeChars>012345678</excludeChars>
      <require>false</require>
      <fieldTitleInMail>Your name</fieldTitleInMail>
      <toolTip>Enter your name</toolTip>
   </object>
   <object>
      <type>TextInput</type>
      <name>txtYourEmail</name>
      <x>150</x>
      <y>80</y>
      <width>200</width>
      <height>22</height>
      <require>true</require>
      <includeChars>@.</includeChars>
      <excludeChars>!#$%^&*()[]{}</excludeChars>
      <require>false</require>
      <fieldTitleInMail>Your Email</fieldTitleInMail>
      <toolTip>Enter your email</toolTip>
   </object>
   <object>
      <type>CheckBox</type>
      <name>chkSendToCustomer</name>
      <x>150</x>
      <y>103</y>
      <width>200</width>
      <height>20</height>
      <value>Send mail to this email too</value>
      <select>true</select>
      <fieldTitleInMail>Also send mail to me</fieldTitleInMail>
      <toolTip>Check this if you want this mail sent to your email too</toolTip>
   </object>

   <!-- Part 2: Internal routing -->
   <object>
      <type>Label</type>
      <name>lblTitleDetail</name>
      <x>10</x>
      <y>130</y>
      <width>400</width>
      <height>20</height>
      <require>false</require>
      <value>Details</value>
      <font>
         <name>Arial</name>
         <size>17</size>
         <bold>true</bold>
         <color>#815bee</color>
      </font>
   </object>

   <object>
      <type>Label</type>
      <name>lblSubject</name>
      <x>10</x>
      <y>170</y>
      <width>430</width>
      <height>20</height>
      <font>
         <bold>true</bold>
      </font>
      <value>Subject</value>
   </object>
   <object>
      <type>TextInput</type>
      <name>txtSubject</name>
      <x>150</x>
      <y>170</y>
      <width>400</width>
      <height>20</height>
      <value></value>
      <require>false</require>
      <fieldTitleInMail>Subject</fieldTitleInMail>
      <toolTip>Enter Subject</toolTip>
   </object>
   <object>
      <type>Label</type>
      <name>lblPhone</name>
      <x>10</x>
      <y>200</y>
      <width>430</width>
      <height>20</height>
      <font>
         <bold>true</bold>
      </font>
      <value>Phone #</value>
   </object>
   <object>
      <type>TextInput</type>
      <name>txtPhone</name>
      <x>150</x>
      <y>200</y>
      <width>200</width>
      <height>20</height>
      <fieldTitleInMail>Phone #</fieldTitleInMail>
      <toolTip>Enter your phone number</toolTip>
   </object>
   <object>
      <type>Label</type>
      <name>lblNote</name>
      <x>150</x>
      <y>220</y>
      <width>430</width>
      <height>20</height>
      <font>
         <italic>true</italic>
         <size>9</size>
      </font>
      <value>A phone number where you can be reached, if desired</value>
   </object>
   <object>
      <type>Label</type>
      <name>lblMessage</name>
      <x>10</x>
      <y>240</y>
      <width>430</width>
      <height>20</height>
      <require>true</require>
      <font>
         <bold>true</bold>
      </font>
      <value>Message</value>
   </object>
   <object>
      <type>RichTextEditor</type>
      <name>txtMessage</name>
      <x>150</x>
      <y>240</y>
      <width>400</width>
      <height>300</height>
      <require>true</require>
      <fieldTitleInMail>Message</fieldTitleInMail>
      <toolTip>Enter comment of our product</toolTip>
   </object>
</objectlist>

And we also need to modify mail_content.php on your PHP server as follow (red text means modified content):

<?php
$mail_subject = $_POST['txtSubject'];
$mail_to = "myservice@enet.org";
$mail_to_name = "Service supporter";
$mail_from = $_POST['txtYourEmail'];
$mail_from_name = $_POST['txtYourName'];
$mail_replyto = $mail_from;
$mail_replyto_name = $mail_from_name;

//Check if customer want to send to herself/himself too
if ($_POST['chkSendToCustomer']=="true")
   $mail_CC = $mail_from;
else
   $mail_CC = "";
$mail_BCC = "";


//default mail content for both plain and html text
//You can replace with with your own content, using dynamic information posted from your designed contact form
$mail_message_html = $_POST['mailHTMLContent'];
$mail_message_plaintext = $_POST['mailPlainContent'];
//You can reassigne $mail_message_html = $mail_message_plaintext, or any value builed from contact form field
?>

Back | Table of Contents | Next

 

Copyright © 2009 Best Flash Solutions, Inc. All rights reserved | Site map