Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mail() only supports 5 fields 1

Status
Not open for further replies.

CTCINY

Programmer
Feb 25, 2005
664
0
0
US
So I am pretty new to web design in general. I created a PHP script to send an email from an HTML form. When I have 3 items it works fine. But I need to put about 8 or 9 fields, and I get a message that the Mail function has a maximum 5 fields. How else can I write the script so that I can send all my fields? Like I said Im still a noob so be gentle. Thanks

___________________________________________
If it's true that our species is alone in the universe, then I'd have to say that the universe aimed rather low and settled for very little.---George Carlin
 
Show us your code.

...message that the Mail function has a maximum 5 fields

The mail function takes a maximum of 5 parameters some of them being optional. This has nothing to do with how many fields you send in the email at all.

The body of the message which would contain any and all fields you wish to send is the third parameter: a.k.a message.

You would need to build your message body so it contains all your fields in that parameter, something like this for example:

Code:
$message = "username is" . $_POST['usernamefield'] ."\r\n";
$message .= "otherfield is " . $_POST['otherfield'] . "\r\n|;
...





----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
That worked perfectly. Now I need to label and format the email. Any suggestions or help?

___________________________________________
If it's true that our species is alone in the universe, then I'd have to say that the universe aimed rather low and settled for very little.---George Carlin
 
You can use basic HTML to format the email. Check the link I provided above for an example. Under HTML Email.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top