473,797 Members | 3,152 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_test 1.php on line 277
What does this mean and how do I solve it?

Thanks,
Corey
Jul 16 '05 #1
3 6703
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_test 1.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.ed u> 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_test 1.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.ed u> 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_test 1.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
5402
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 scripts. I'm trying to write a basic Python email CGI script to send email through HTML email form. I've seen a lot of examples out there, but nothing I tried so far seemed to work. So I would like to know what I am doing wrong.
5
2638
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 depending on member expiration dates. When the form is submitted, the code loops through the form contents and sends an email to those members that meet the selected criteria. All this worked perfectly when I was sending text emails, but since I
5
15936
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. Public Function PrintPDFemail2() ' This will create the PDF if the report is setup for it DoCmd.OpenReport "rptJobItemStat", acViewNormal
5
4889
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 SMTP though, but was able to do this though one of my personal account, Cabbage.Org. It doesn't make any sense to me why this works and no other account, including localhost and the remote server which hosts the website. Here is a code snippet...
1
2134
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 button an input box should appear asking for an email address and then an email should be sent to that address with an attachement. The other button should send an email to all the addresses in the email address field in a table.
9
2209
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 while (This information is just for general knowledge as I don't want anyone thinking I am trying to be dishonest with my intentions. Also, I do not portray myself as something I am not. I am a beginner.) Anyway, what the script needs to do is...
6
1942
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 email address, subject & message. Please help! /* BELLonline PHP MAILER SCRIPT v1.4 Copyright 2006 Gavin Bell http://www.bellonline.co.uk gavin@bellonline.co.uk modified by Craig Fisher for Dakota Portraits - 1-30-2006 */
4
3453
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 for site status: $live = TRUE; // Test output switching status from TRUE; to FALSE;
0
2042
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 on (release, keyPress "<Enter>") { if (company ne "" and first ne "" and last ne "" and phone ne "" and fax ne "" and mobile ne "" and email ne "" and address ne "" and city ne "" and state ne "" and zip ne "") { i = "0"; validmail = 0;...
9
2608
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
9685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9537
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10246
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10209
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10023
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9066
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6803
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4135
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2934
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.