So much to my annoyance - im stuck with 1and1, which 'just' runs the website ive built nicely, however I need to send emails from certain pages - which normally i don't have an issue however on 1and1 this is not the case. they outright block any SMTP (see email below) but advise to use sendmail which for some reason I cannot get working with formit (bobrays quick email snippet runs fine and sends the mails so i must be missing something)
anyway on to the email:
Please be informed that sending emails using SMTP via webspace is not supported. Using it directly is risky, as you have to follow SMTP protocol rather perfectly. Otherwise, you fail. And most scripts cannot handle errors -- then vital information like the messages, get lost. So we strongly discourage our customers from using direct SMTP in their scripts. However, there is a perfect substitute for sending messages: the binary /usr/lib/sendmail or in PHP, the function mail().
So, your script does not follow SMTP closely enough thus we recommend "sendmail" or just PHP::mail().
Thanks for that help...
anyhoo,
can someone please cast their eye over this to just check i'm not missing anything dumb?
basic call
[[!FormIt?
&hooks=`email,math,redirect`
&emailTpl=`ContactForm`
&emailTo=`email address`
&redirectTo=`83`
]]
Form Code
[[!+fi.error_message:notempty=`<p>[[!+fi.error_message]]</p>`]]
<form action="[[~[[*id]]]]" method="post" class="form">
<ul>
<li class="half">
<span class="error">[[!+fi.error.name]]</span>
<input type="text" name="name" id="name" value="[[!+fi.name]]" placeholder="Name" />
</li>
<li class="half">
<span class="error">[[!+fi.error.email]]</span>
<input type="text" name="email" id="email" value="[[!+fi.email]]" placeholder="Email"/>
</li>
<li class="half">
<span class="error">[[!+fi.error.company]]</span>
<input type="text" name="company" id="company" value="[[!+fi.company]]" placeholder="Company"/>
</li>
<li class="half">
<span class="error">[[!+fi.error.tel-no]]</span>
<input type="text" name="tel-no" id="tel-no" value="[[!+fi.tel-no]]" placeholder="Telephone" />
</li>
<li class="full">
<span class="error">[[!+fi.error.math]]</span>
<input type="text" name="math" value="[[!+fi.math]]" placeholder="Solve this equation: [[!+fi.op1]] [[!+fi.operator:is=`-`:then=`minus`:else=`plus`]] [[!+fi.op2]]?"/>
<input type="hidden" name="op1" value="[[!+fi.op1]]" />
<input type="hidden" name="op2" value="[[!+fi.op2]]" />
<input type="hidden" name="operator" value="[[!+fi.operator]]" />
</li>
<br class="clear" />
<div class="form-buttons">
<input type="submit" value="Submit Request" />
</div>
</form>
and finally the chunk
[[+name]], [[+company]], [[+email]], [[+tel-no]]
Theres nothing to strenous but i just cannot post the email through their servers...
Any help would be appreciated cos apart from switching hosts im at a blank.
Cheers
Tyr