[TYPO3] Solution for mailform not sending; Ah, dont look now but....

Andrew Davis andrew at avagraphique.com
Wed Jun 6 00:35:31 CEST 2007


Hi friendly, patient community

...Works fine on my testing server. But in production, this does not 
work. I check to make sure that the strict and secure settings are off 
in install tool
test the email install tool works fine.


Here is exact code from setup on the template, no other code in 
template, template clears constants and setup 
.................................................


tt_content.mailform >
temp >

temp.form = FORM

temp.form.hiddenFields.subject = TEXT
temp.form.hiddenFields.subject.value = the subject !!

temp.form.hiddenFields.htmlEnabled = TEXT
temp.form.hiddenFields.htmlEnabled.value = 1
temp.form.hiddenFields.htmlEnabled.id = test

temp.form.locationData = 1
temp.form.formName = mailform
temp.form.formId = mailform
temp.form.recipient = andrew at avagraphique.com
temp.form.layout = ###LABEL### ###FIELD###<br />
temp.form.dataArray{
   10.type = name=input
   10.label=YourName
   20.type = formtype_mail=submit
   20.value = submit
}

page = PAGE
page.5 < this_label
page.10 < temp.form





Here is the generated html..................................

<form action="index.php?id=95" id="mailform" name="mailform" 
enctype="multipart/form-data" method="post">
<div style="display:none;">
   <input type="hidden" name="recipient" 
value="dbb8775582:VFlTFwNGcVRCB1RAVUAJDUQXXExXXl4=" />
   <input type="hidden" name="locationData" value="95:pages:95" />
   <input type="hidden" name="subject" value="the subject !!" />
   <input type="hidden" name="htmlEnabled" value="1" />
</div>
YourName <input type="text" name="name" size="20" value="" /><br /> 
<input type="submit" name="formtype_mail" value="submit" /><br />
</form>




? thoughts (please do not say "give up" ;-) )
Thanks
Andrew






Andrew Davis wrote:
> Thanks everyone for their patience. I decided to simplify (lose all the 
> < mailform copying of stuff, since i had no idea what it was doing... 
> and get my output to output the same as he normal mailform content 
> item... which seems to have worked:
> 
> 
> 
> #My label, just to see that ANYTHING is outputting to the page
> this_label = TEXT
> this_label.value = test form
> 
> #Make form object
> temp.form = FORM
> 
> temp.form.locationData = 1
> temp.form.formName = mailform
> temp.form.formId = mailform
> temp.form.recipient = andrew at avagraphique.com
> temp.form.layout = ###LABEL### ###FIELD###<br />
> temp.form.dataArray{
> 
>   10.type = name=input
>   10.label=YourName
>   20.type = formtype_mail=submit
>   20.value = submit
> }
> 
> #Copy objects to the page
> page = PAGE
> page.5 < this_label
> page.10 < temp.form
> 
> 
> wow, that was a long one...
> Andrew
> 
> 
> 
> 
> Andrew Davis wrote:
>> hi,
>>
>> required fields seem to be validating, but my Mailform simply reloads 
>> page but does not send.... any ideas? Thanks much in advance
>>
>>
>>
>>
>> # we define a form object
>> temp.form = FORM
>>
>> # now we import the standard mailfrom from the styles.content class
>> temp.form < styles.content.mailform
>>
>> # we override some values
>> temp.form {
>>   layout = <p>###LABEL### <br />###FIELD###</p>
>>   labelWrap.wrap = <strong>|</strong>
>>   fieldWrap.wrap = |<br />
>>   commentWrap.wrap = |
>>   radioWrap.wrap = |&nbsp;
>>   stdWrap.wrap= |
>>   recipient = junk at avagraphique.com
>>   goodMess = Thank you for submitting your request. We will respond 
>> within 48 hours.
>>
>>   REQ = 1
>>   REQ.labelWrap = |*
>>   REQ.layout = <p>###LABEL### <br />###FIELD###</p>
>>   #    redirect = 4
>>
>>   # until this point we have inserted some values, but they are not in 
>> the form, yet.
>>   # So we add our data to the form by the dataArray.
>>   # Finally we need it as hidden form element:
>>   dataArray {
>>     1.label = Request for more information
>>     1.label.wrap = <h2>|</h2>
>>         10.label = Model:
>>     10.type = model=input
>>     10.value = {GPvar : model}
>>     10.value.insertData=1
>>     10.required = 1
>>     10.width = 2
>>         20.label = Quantity:
>>     20.type = qty=radio
>>     20.valueArray{           1.label = 1000
>>         1.value = 1000
>>         2.label = 5000
>>         2.value = 5000
>>         3.label = 10000
>>         3.value = 10000
>>         4.label = 50000
>>         4.value = 50000
>>         5.label = 100000
>>         5.value = 100000
>>         6.label = other
>>         6.value = see qty_other
>>     }
>>     20.required = 1
>>         21.label = Quantity Other:
>>     21.type= qty_other=input
>>         50.label = Your Information
>>     50.label.wrap = <br / ><br /><h3>|</h3>
>>         60.label = First Name:
>>     60.type= fname=input
>>     60.required = 1
>>         65.label = Last Name:
>>     65.type = lname=input
>>     65.required = 1
>>         70.label = Company:
>>     70.type= company=input
>>     70.required = 1
>>         80.label = Email:
>>     80.type= email=input
>>     80.specialEval = EMAIL
>>     80.required = 1
>>         90.label = Phone:
>>     90.type= phone=input
>>     90.required = 1
>>         100.label = Fax:
>>     100.type= fax=input
>>         110.label = Address:
>>     110.type= address=input
>>         120.label = City:
>>     120.type= city=input
>>         130.label = State:
>>     130.type= state=select
>>     130.valueArray {
>>           1.label = NY
>>           1.value = NY
>>           2.label = AZ
>>           2.value = AZ
>>           20.selected = 1
>>         }
>>         140.label = Postal Code:
>>     140.type= postal=input
>>         150.label = Country:
>>     150.type= country=select
>>     150.required = 0
>>         160.label = Comments:
>>     160.type= comments=textarea
>>
>>     500.type = submit=submit
>>     500.value = Submit
>>
>>   }
>> }
>>
>> # Now this is important too: We need to re-import our mailform back 
>> into the
>> # content.default class. The reason is that this class is normally 
>> being processed
>> # earlier, therefore we have to reimport it to make our changes to the 
>> default class work
>> tt_content.mailform.20  < temp.form
>>
>> #### End more info form


More information about the TYPO3-english mailing list