Hi y'all

I'm probably trying to do something ridicolously trivial, but here goes:

I'm building a form for sending mail of my website. The idea is simply
that people plop in their address, the message, and pick a subject line,
and then click send.

It will then show how the message will look, and people will then have the
option to either correct it, send it there and then, or just dump the
whole enchilada...

Q 1:

Well, building the form and making the page preview the message is the
easy part. But how do I make the page retain the message so that I can 1.
actually send the thing after the second submit, and 2. make it fill out
the form when user wish to alter message (or there's an error) ???

This is the code for the preview part (HTML + PHP):

        <span class="txt">This is the message as it will look with all
headers:</span>
        <pre><?php
            $to = "[EMAIL PROTECTED]";
            $from = "Metalbunny website <[EMAIL PROTECTED]>";
            $replyto = $HTTP_POST_VARS['sender'];
            $subject = $HTTP_POST_VARS['subject'];
            $message = $HTTP_POST_VARS['message'];
            $headers = "MIME-Version: 1.0\r\n";
            $headers .= "Content-type: text/ascii;
charset=iso-8859-1\r\n";
            $headers .= "From: ".$from."\r\n";
            $headers .= "Reply-to: ".$replyto."\r\n";
            
            echo("To: ".$to."\n");
            echo("From: ".$from."\n");
            echo("Reply-to: ".$replyto."\n");
            echo("Subject: ".$subject."\n");
            echo("X-Mailer: PHP/".phpversion()."\n");
            echo("MIME-version: 1.0\n");
            echo("Content-type: text/ascii; charset=iso-8859-1\n");
            echo("\n".$message);
          ?>
        </pre><br>
        <br>
        <span class="txt">Do you wish to send this message?</span><br>
        <form method="post">
          <button name="send" value="true" type="submit">Yes, send
it</button>
          <button name="correct" value="true" type="submit">Nah, let me
correct it</button>
          <button name="cancel" value="true" type="submit">Never
mind...</button>
        </form>

The first button is to actually send the message, and show the "Thank you"
page, the second is to reload the form and fill out the fields. Haven't
figured out how to work the last button.

Q 2:

The manual doesn't really say it that clearly, but do I need to have the
content-type field when the message is plain text already?
And should I be adding a Date: field, or does the mail() function figure
that out itself?

My incoming mail server does not accept messages without a date field, so
if I need to add it, I'd really like to know. It also doesn't like
messages with more than 1 of each field...(except received-by).


TIA

Rene
-- 
Rene Brehmer

This message was written on 100% recycled spam.

Come see! My brand new site is now online!
http://www.metalbunny.net

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to