Index: quintagroup.transmogrifier.pfm2pfg/trunk/quintagroup/transmogrifier/pfm2pfg/importing.py
===================================================================
--- quintagroup.transmogrifier.pfm2pfg/trunk/quintagroup/transmogrifier/pfm2pfg/importing.py	(revision 329)
+++ quintagroup.transmogrifier.pfm2pfg/trunk/quintagroup/transmogrifier/pfm2pfg/importing.py	(revision 330)
@@ -371,7 +371,6 @@
 
     def modifyData(self):
-        # if 'default' element in field's xml is not empty, self.data['default'] is DateTime object
-        # we need to from it simple string
         if 'default' in self.data:
+            # convert from DateTime object to string
             self.data['default'] = str(self.data['default'])
             self.renameEntry('default', 'fgDefault')
Index: quintagroup.transmogrifier.pfm2pfg/trunk/quintagroup/transmogrifier/pfm2pfg/tests/complex_form.xml
===================================================================
--- quintagroup.transmogrifier.pfm2pfg/trunk/quintagroup/transmogrifier/pfm2pfg/tests/complex_form.xml	(revision 329)
+++ quintagroup.transmogrifier.pfm2pfg/trunk/quintagroup/transmogrifier/pfm2pfg/tests/complex_form.xml	(revision 330)
@@ -2,5 +2,5 @@
 <metadata xmlns="http://plone.org/ns/archetypes/" xmlns:cmf="http://cmf.zope.org/namespaces/default/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xmp="adobe:ns:meta">
     <dc:title>
-        Publish new content management product or module
+        Test form
     </dc:title>
     <dc:creator>
@@ -22,6 +22,39 @@
         2007/12/04 03:25:47.294 US/Central
     </field>
+    <field name="subject">
+        string:Test form submit
+    </field>
+    <field name="recipient_name">
+        Test
+    </field>
     <field name="recipient_email">
-        string:test@mail.com
+        string:recipient@mail.org
+    </field>
+    <field name="cc_recipients">
+        cc1@mail.org
+    </field>
+    <field name="cc_recipients">
+        cc2@mail.org
+    </field>
+    <field name="bcc_recipients">
+        bcc1@mail.org
+    </field>
+    <field name="bcc_recipients">
+        bcc2@mail.org
+    </field>
+    <field name="additional_headers">
+        Header1: value1
+    </field>
+    <field name="additional_headers">
+        Header2: value2
+    </field>
+    <field name="body_pre">
+        Next are input fields
+    </field>
+    <field name="body_post">
+        You have filled all necessary fields
+    </field>
+    <field name="body_footer">
+        It's built on Plone
     </field>
     <field name="body_pt">
@@ -79,10 +112,16 @@
     </field>
     <field name="sent_title">
-        The form was send to editor.
+        The form was sent.
     </field>
     <field name="sent_message">
-        
-&lt;p&gt;Thank you for new content. Our editor will review your request.&lt;br /&gt;&lt;/p&gt;
 
+        &lt;p&gt;Thank you for submiting it.&lt;br /&gt;&lt;/p&gt;
+
+    </field>
+    <field name="sent_redirect">
+        string:test
+    </field>
+    <field name="cpyaction">
+        script
     </field>
     <uid>
@@ -113,11 +152,4 @@
         <cmf:local_role role="Owner" user_id="admin"/>
     </cmf:security>
-    <field name="recipient_name">
-        ContentManagementSoftware.Info
-    </field>
-    <field name="subject">
-        string:Update Software
-    </field>
-
 <form>
   <title>PFM Formulator</title>
Index: quintagroup.transmogrifier.pfm2pfg/trunk/quintagroup/transmogrifier/pfm2pfg/tests/test_import.py
===================================================================
--- quintagroup.transmogrifier.pfm2pfg/trunk/quintagroup/transmogrifier/pfm2pfg/tests/test_import.py	(revision 329)
+++ quintagroup.transmogrifier.pfm2pfg/trunk/quintagroup/transmogrifier/pfm2pfg/tests/test_import.py	(revision 330)
@@ -1,4 +1,5 @@
 import unittest
 import os.path
+import email
 
 from zope.interface import classProvides, implements
@@ -84,9 +85,9 @@
         form = self.portal['complex-form']
 
-        self.assertEqual(form['title'], 'Publish new content management product or module')
+        self.assertEqual(form['title'], 'Test form')
         self.assertEqual(form.getFormPrologue(), '<p>form prologue</p>')
         self.assertEqual(form.getFormEpilogue(), '<p>form epilogue</p>')
-        #self.assertEqual(form['thanksPageOverride'], 'string:')
-        #self.assertEqual(form['afterValidationOverride'], 'redirect_to:')
+        self.assertEqual(form['thanksPageOverride'], 'redirect_to:string:test')
+        self.assertEqual(form['afterValidationOverride'], 'string:script')
 
     def test_mailer(self):
@@ -95,7 +96,14 @@
         mailer = form['mailer']
 
-        self.assertEqual(mailer['subjectOverride'], 'string:Update Software')
-        self.assertEqual(mailer['recipientOverride'], 'string:test@mail.com')
+        self.assertEqual(mailer['subjectOverride'], 'string:Test form submit')
+        self.assertEqual(mailer['recipient_name'], 'Test')
+        self.assertEqual(mailer['recipientOverride'], 'string:recipient@mail.org')
+        self.assertEqual(mailer['additional_headers'], ('Header1: value1', 'Header2: value2'))
         self.assertEqual(mailer['body_type'], 'html')
+        self.assertEqual(mailer.getBody_pre(), 'Next are input fields')
+        self.assertEqual(mailer.getBody_post(), 'You have filled all necessary fields')
+        self.assertEqual(mailer.getBody_footer(), 'It\'s built on Plone')
+        self.assertEqual(mailer['cc_recipients'], ('cc1@mail.org', 'cc2@mail.org'))
+        self.assertEqual(mailer['bcc_recipients'], ('bcc1@mail.org', 'bcc2@mail.org'))
 
         self.assertEqual(mailer.created(), form.created())
@@ -107,7 +115,7 @@
         page = form['thank-you']
 
-        self.assertEqual(page.Title(), 'The form was send to editor.')
+        self.assertEqual(page.Title(), 'The form was sent.')
         self.assertEqual(page.getThanksPrologue(), 
-            '<p>Thank you for new content. Our editor will review your request.<br /></p>')
+            '<p>Thank you for submiting it.<br /></p>')
 
         self.assertEqual(page.created(), form.created())
@@ -409,7 +417,39 @@
         self.assertEqual(fieldset.objectIds(), ['email', 'float', 'string'])
 
+class FakeRequest(dict):
+
+    def __init__(self, **kwargs):
+        self.form = kwargs
+
+class TestSubmit(ptc.PloneTestCase):
+    """ test ya_gpg.py """
+
+    def dummy_send(self, mfrom, mto, messageText):
+        self.mfrom = mfrom
+        self.mto = mto
+        self.messageText = messageText
+
+    def afterSetUp(self):
+        transmogrifier = ITransmogrifier(self.portal)
+        transmogrifier('test_import')
+        self.form = getattr(self.folder, 'complex-form')
+        for i in self.form.contentValues():
+            field = i.getField('required')
+            if field is not None:
+                field.getMutator(i)(False)
+        self.mailhost = self.folder.MailHost
+        self.mailhost._send = self.dummy_send
+
+    def test_submitting(self):
+        """ Test submitting of form """
+        request = FakeRequest(field2='field2@mail.org')
+        errors = self.form.fgvalidate(REQUEST=request)
+        msg = email.message_from_string(self.messageText)
+        self.assertEqual(msg.get('To'), 'Test <recipient@mail.org>')
+        self.assertEqual(msg.get('Subject'), '=?utf-8?q?Test_form_submit?=')
 
 def test_suite():
     suite = unittest.TestSuite()
     suite.addTest(unittest.makeSuite(TestImport))
+    suite.addTest(unittest.makeSuite(TestSubmit))
     return suite
