473,396 Members | 1,683 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

email error

Hello,

I have created a form that is sent via email and am getting the
following error:

Warning: mail() expects at most 5 parameters, 14 given in
/home/sites/site324/web/order_form_test1.php on line 277
What does this mean and how do I solve it?

Thanks,
Corey
Jul 16 '05 #1
3 6689
Corey wrote:
Hello,

I have created a form that is sent via email and am getting the
following error:

Warning: mail() expects at most 5 parameters, 14 given in
/home/sites/site324/web/order_form_test1.php on line 277
What does this mean and how do I solve it?

Thanks,
Corey


Exactly what it says: You pass 14 parameters to the mail() function,
where 5 is the maximum number of parameters for the mail function. It
needs 3 parameters at least and max 5.
See: http://nl2.php.net/manual/en/ref.mail.php

Regards,
Ruben.

Jul 16 '05 #2
Joshua Ghiloni <jd***@SPAM.ME.AND.DIE.cwru.edu> wrote in message news:<be**********@eeyore.INS.cwru.edu>...
Corey wrote:
Hello,

I have created a form that is sent via email and am getting the
following error:

Warning: mail() expects at most 5 parameters, 14 given in
/home/sites/site324/web/order_form_test1.php on line 277
What does this mean and how do I solve it?

Thanks,
Corey

My guess is that you are passing each header as a parameter. All
additional headers are to be in one field.


Sorry still confused--Here is the code I am referring to.

{
$sendto = "cg*****@cinci.rr.com";
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$address = $_POST['address'];
$city = $_POST['city'];
$state = $_POST['state'];
$zipcode = $_POST['zipcode'];
$phone = $_POST['phone'];
$image1 = $_POST['image1'];
$size1 = $_POST['size1'];
$quantity1 = $_POST['quantity1'];
$image2 = $_POST['image2'];
$size2 = $_POST['size2'];
$quantity2 = $_POST['quantity2'];
$comments = $_POST['comments'];

mail( "$sendto",
"First name: $firstname", "Last name: $lastname", "City: $city",
"State: $state", "Zip Code: $zipcode", "Phone: $phone",
"Image1: $image1", "Size1: $size1", "quantity1: $quantity1",
"Image 2: $image2", "Size2: $size2", "quantity2: $quantity2",
"$comments" );
}
Jul 16 '05 #3
Corey wrote:
Joshua Ghiloni <jd***@SPAM.ME.AND.DIE.cwru.edu> wrote in message news:<be**********@eeyore.INS.cwru.edu>...
Corey wrote:
Hello,

I have created a form that is sent via email and am getting the
following error:

Warning: mail() expects at most 5 parameters, 14 given in
/home/sites/site324/web/order_form_test1.php on line 277
What does this mean and how do I solve it?

Thanks,
Corey


My guess is that you are passing each header as a parameter. All
additional headers are to be in one field.

Sorry still confused--Here is the code I am referring to.

{
$sendto = "cg*****@cinci.rr.com";
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$address = $_POST['address'];
$city = $_POST['city'];
$state = $_POST['state'];
$zipcode = $_POST['zipcode'];
$phone = $_POST['phone'];
$image1 = $_POST['image1'];
$size1 = $_POST['size1'];
$quantity1 = $_POST['quantity1'];
$image2 = $_POST['image2'];
$size2 = $_POST['size2'];
$quantity2 = $_POST['quantity2'];
$comments = $_POST['comments'];

mail( "$sendto",
"First name: $firstname", "Last name: $lastname", "City: $city",
"State: $state", "Zip Code: $zipcode", "Phone: $phone",
"Image1: $image1", "Size1: $size1", "quantity1: $quantity1",
"Image 2: $image2", "Size2: $size2", "quantity2: $quantity2",
"$comments" );
}

Change that to
mail ("$sendto",
"insert subject here", # <--- The second parameter is the #
subject, and is required.
"First name: $firstname\n" .
"Last name: $lastname\n" .
...
"$comments");

You see, when you put the commas between each key-value pair--what I
assume to be discrete lines of the email--mail() is reading each them as
parameters to the function. Instead, the entire body needs to be one
long string. The . operator accomplishes this. It is necessary, but
makes it a bit more readable.

HTH
Josh

Jul 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: bojanraic | last post by:
Hi! I recently started playing with Python CGI, and I was happy that my basic input-name--print-hello-name CGI form example worked, so I thought I should advance to somew\hat more complicated...
5
by: BaWork | last post by:
I have a web form where a client can select which site members to send an email to. This form is populated from the contents of the member table, so the form can have 0-x names listed on it...
5
by: paii, Ron | last post by:
How do I setup a email with attachment for preview but require the user to push the SEND button in Outlook. I have the following function but it sends the email without the sender ever seeing it. ...
5
by: Mark A. Sam | last post by:
Hello, I am sending two emails from the same procedure, one to myself (while testing) and another (a comfirmation) to the user on the website. I was having difficulty finding a relay server to...
1
by: darklink64 | last post by:
Hi, I've recently set up a database, but have not experience of VBA and need to find a way of solving this problem. Basically, I would like to make a form with two buttons. On clicking one...
9
by: Jerim79 | last post by:
I am no PHP programmer. At my current job I made it known that I was no PHP programmer during the interview. Still they have given me a script to write with the understanding that it will take me a...
6
by: cfish | last post by:
I'm trying to script my contact page and I have everything the way I want it however I cannot get my script to output Address, City, State, Zip & Phone Number when I get a email. It will output...
4
Odisey
by: Odisey | last post by:
Hello, I am attempting to send an error_log() message to my email. I don't see any mistakes - yet it is not sending the email.... Any ideas? <?php #Script 6.2 //Flag variable...
0
by: gervo | last post by:
I have built a series of email forms in flash MX. using perl. the forms work for some people but not all and I was hoping some one could help me out. Here is the Actionscript on the send button ...
9
by: luke noob | last post by:
This is my script..... <?php $to = "example@example.co.uk"; $subject = "subject"; //minimum characters allowed in the message box $msg_min_chars = "10";
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.