Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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...
    4. #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: ...
    5. 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,...
  3. #2

    Default Re: email error

    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: [url]http://nl2.php.net/manual/en/ref.mail.php[/url]

    Regards,
    Ruben.

    Ruben van Engelenburg Guest

  4. #3

    Default Re: email error

    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" );
    }
    Corey Guest

  5. #4

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139