Re: mail function and lots of form fields
| From: | Chip | Date: | Wed, 17 Oct 2001 23:47:14 +0000 |
| Subject: | Re: mail function and lots of form fields | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-71422@lists.php.net to get a copy of this message | ||
On Wednesday 17 October 2001 15:38, Richard Baskett wrote:
> For the body what I usually do, if you're planning on just a regular text
> email, is to make an include file with this type of formatting:
I guess you mean I can use an include file in my variable? Like this:
$body = newbody.inc
Does the variable need to be quoted? I think most likely, but am not sure.
I'll check into this more tomorrow at work.
--
Chip Wiegand
> $body ="
> This is the header of the email message
>
> Greetings $name,
>
> How are you today, you've spent $amount of dollars in the last $days.
>
> Thank You!
>
> Management";
>
> In other words when you do something like this you can actually see the
> formatting and all the \n's or \r's will be there. I have found this to
> bed the easiest way of doing email formatting. I hope it makes sense to
> you, if not you can always write me back and Ill have another go at
> explaining it :)
>
> Rick
>
> > I have a form with around 50 text fields. I have used the mail function
> > to send
> > forms with simple textarea's, names, and email addresses, but what about
> > when
> > I have around 50 fields to send?
> > I am using the following format for my mails:
> > <?
> > if(isset($submit)):
> > $date = date("M d, Y");
> > $to = "seattle.webmaster@simrad.com";
> > $subject = "Web Site Comments";
> > $body = "On $date\n $name\n ($email) wrote<br><br>" .
> > $feedback;
> > mail($to, $subject, $body, "From:$email\nContent-Type: text/html;
> > charset=iso-8859-1\nMime-Version: 1.0\nX-Mailer: PHP/" . phpversion());
> > print("<h3>Thanks for the comments!</h3>\nWe appreciate you
> > taking the time to share your thoughts with us.");
> > else:
> > ?>
> > The fields $feedback, $name, $email are from the form, but I have another
> > form with around 50
> > fields. Is there an alternative to listing all 50or so fields on that one
> > $body line? I'd like
> > the final message to have a reasonable amount of formatting to keep the
> > many fields sorted out and easy to read.
> > --
> > Chip Wiegand
> > Computer Services
> > www.simradusa.com
> > chip.wiegand@simrad.com
> > Simrad, Inc
> > Lynnwood, WA
> > 425-712-1138
> >
> > "There is no reason anyone would want a computer in their home."
> > --Ken Olson, president, chairman and founder of Digital Equipment Corp.,
> > 1977
> > (-- Then why do I have nine? Somebody help me!)
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
--
Chip W.