Ask a Question related to PHP Development, Design and Development.
-
Corey #1
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
Corey Guest
-
Email PDF through Groupwise 6.0 - Form error help please?
We just installed 7 new XP Pro workstations with Acrobat 6.0 factory installed. I installed Novell client 4.90 sp1, and Groupwise client for GW... -
link to email without error page
When I create a link to email using on (release) { "mailto:info@mywebsite.com" } I first get a new blank page that says "this page cannot be... -
error on finding email domain
Two ISPs are blocking email from a community service webiste and I need to alert users to not sign up using an address at one of these ISPs. My... -
#26120 [Opn->Bgs]: ERROR WHEN TRYING TO REMOVE EMAIL ADDRESS
ID: 26120 Updated by: jay@php.net Reported By: gajarvis at iquest dot net -Status: Open +Status: ... -
error message (email)
The host 'SMTP' could not be found. Please verify that you have entered the server name correctly. Account: 'IMAP', Server: 'SMTP', Protocol: SMTP,... -
Ruben van Engelenburg #2
Re: email error
Corey wrote:
Exactly what it says: You pass 14 parameters to the mail() function,> 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
where 5 is the maximum number of parameters for the mail function. It
needs 3 parameters at least and max 5.
See: [url]http://nl2.php.net/manual/en/ref.mail.php[/url]
Regards,
Ruben.
Ruben van Engelenburg Guest
-
Corey #3
Re: email error
Joshua Ghiloni <jdg11@SPAM.ME.AND.DIE.cwru.edu> wrote in message news:<bekp4h$kv5$1@eeyore.INS.cwru.edu>...
Sorry still confused--Here is the code I am referring to.> Corey wrote:> My guess is that you are passing each header as a parameter. All> > 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
> additional headers are to be in one field.
{
$sendto = "cgooley@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" );
}
Corey Guest
-
Joshua Ghiloni #4
Re: email error
Corey wrote:
> Joshua Ghiloni <jdg11@SPAM.ME.AND.DIE.cwru.edu> wrote in message news:<bekp4h$kv5$1@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 = "cgooley@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
Joshua Ghiloni Guest



Reply With Quote

