Home > Archive > PHP Smarty Templates > March 2004 > Forms Generation / Validation with mimemessage --M.Lemos
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Forms Generation / Validation with mimemessage --M.Lemos
|
|
| Upfront Technology 2004-03-19, 1:29 pm |
| Hello All,
I am using Forms Validation and MIME Message classes by M.Lemos. I can
successfully create and display the form, as well as successfully get the
MIME Message examples included in the documentation to work perfectly.
However, when trying the hack the Form code and the MIME code, I get a bit
lost.
Here is my problem:
referencing a past e-mail...
////////////////////////////////////////////////////////////////////////////
/////////////
On 02/16/2004 10:17 AM, Upfront Technology wrote:
> I am currently developing an online form using "HTML Forms generation and
> validation". I am quite fond of this class, but need to know if anyone
can
> either give an example or point me to example code that allows the form to
> e-mail the results to a desired recipient.
>
> I have read the documentation and noticed comments the suggest a point in
> the code where addition actions could be called, but no examples of mail
> were shown.
The examples of sending e-mail with Smarty are in another class for
sending e-mail:
http://www.phpclasses.org/mimemessage
For sending form via e-mail, just use the forms class output as text
string and feed to the e-mail class as in the example.
Keep in mind that you should disable the generation of Javascript in
e-mail messages or else your messages may get blocked by spam filters.
Most e-mail programs have Javascript support disabled by default for
security reasons.
////////////////////////////////////////////////////////////////////////////
/////////////
Now...
Could I get an example of "just use the forms class output as text
string and feed to the e-mail class"? I know this uses "FormCaptureOutput",
but I can't get the structure right.
something like:
$variable_to_hold_the_form_data_string=F
ormCaptureOutput([$not sure
here],array[not sure here]);
this (I believe) is then passed to the "CreateQuotedPrintableTextPart"
method (this code would replace $subscription->ReadOnly=1; in the forms
example):
/**********************/
<?
[required variables, etc]
$email_message-> CreateQuotedPrintableTextPart($email_mes
sage->WrapText($vari
able_to_hold_the_form_data_string),"",$text_part)
/* Send the message checking for eventually acumulated errors */
$error=$email_message->Send();
if(strlen($error))
break;
?>
/**********************/
I could sure use some help.
Thanks So Much
Joe E.
UpFront Technology
| |
| Manuel Lemos 2004-03-19, 1:29 pm |
| Hello,
On 03/18/2004 10:53 PM, Upfront Technology wrote:
> Could I get an example of "just use the forms class output as text
> string and feed to the e-mail class"? I know this uses "FormCaptureOutput",
> but I can't get the structure right.
>
> something like:
>
> $variable_to_hold_the_form_data_string=F
ormCaptureOutput([$not sure
> here],array[not sure here]);
>
> this (I believe) is then passed to the "CreateQuotedPrintableTextPart"
> method (this code would replace $subscription->ReadOnly=1; in the forms
> example):
>
> /**********************/
> <?
> [required variables, etc]
>
> $email_message-> CreateQuotedPrintableTextPart($email_mes
sage->WrapText($vari
> able_to_hold_the_form_data_string),"",$text_part)
The forms are in HTML, so you should use the example of sending HTML
messages of the MIME message class. HTML messages should have an
alternative text part or else spam filters may reject your message. The
HTML mail example demonstrates how to compose and send a message with
both text and HTML alternative parts.
The text part should be created with CreateQuotedPrintableTextPart
function and the HTML part with CreateQuotedPrintableHTMLPart.
As text part you may just specify a text to warn users of plain text
only e-mail programs. As HTML part you speciy a string that has the HTML
of a page with the forms class output within it.
--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
|
|
|
|
|