473,405 Members | 2,185 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,405 software developers and data experts.

problem with php mail() function (too many parms)

9
Hi, please can someone help with a PHP error.

I am trying to get a form on my website up and running with a PHP script. I've tested a PHP file on the server (and checked with my host) and all is OK.

When I upload my script and form I get the error message below, does anyone know what I might me doing to cause this.

I did comment out the bottom section because I don't think I actually need them, I was getting the error before doing that anyway. I've also replaced website/e-mail addresses.

P.S. this is my first time using PHP.

Thanks in advance.



Error message:
Warning: mail() expects at most 5 parameters, 6 given in /vhost/vhost4/m/o/n/myaddress.co.uk/www/iopost.php on line 22
response=passed


PHP Script:
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. //create short variable names
  3. $fullName=$_POST['fullName'];
  4. $fullAddress=$_POST['fullAddress'];
  5. $postcode=$_POST['postcode'];
  6. $telNumber=$_POST['telNumber'];
  7. $emailAddress=$_POST['emailAddress'];
  8. $fullName =trim($fullName);
  9. $fullAddress =trim($fullAddress);
  10. $postcode=StripSlashes($postcode);
  11. $telNumber =StripSlashes($telNumber);
  12. $emailAddress =StripSlashes($emailAddress);
  13.  
  14. //modify the next line with your own email address
  15. $toaddress='myaddress@mail.co.uk';
  16.  
  17. mail($fullName,$fullAddress,$postcode,$telNumber,$emailAddress,"From: $fullName <$emailAddress >");
  18.  
  19. //clear the variables
  20. //$fullName='';
  21. //$fullAddress='';
  22. //$postcode='';
  23. //$telNumber='';
  24. //$emailAddress='';
  25. //echo "response=passed";
  26.  
  27. ?>
  28.  
Oct 16 '07 #1
2 1566
ronverdonk
4,258 Expert 4TB
The format of the MAIL() command is
Expand|Select|Wrap|Line Numbers
  1. mail ( string $to, string $subject, string $message [, string $additional_headers [, string $additional_parameters]] ).
You have too many parms, like the postal code or a telephone number are never specified as a mail() parameter.

See THIS LINK TO PHP MAIL DOC

Ronald
Oct 16 '07 #2
DMcN
9
Thanks for the speedy reply Ronald.

Does this mean if I delete the code:

Expand|Select|Wrap|Line Numbers
  1. $postcode,$telNumber,$  emailAddress,
  2.  
I will lose that particular info from my form or does it get picked up from the top section, or should I format it in another way.

Thanks again.
Oct 16 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: JT | last post by:
how can i declare a function that will accept an optional parameter? something like: function newFunc(strValue1, strValue2) --where strValue2 is optional. thanks much.
1
by: Murat Aykut | last post by:
I want to write Video Grabber program. For this purpose, I'm using VFW capCapture structure, and DrawDibDraw on printing to screen. I wrote that code, but it has no action (for frame rate). Plaese...
1
by: Esther Lane | last post by:
Hello! First off, many many thanks to Albert who wrote the Mail Merge code for MS Access I am using. It has been working beautifully for a few years. However, my client just (without notice!)...
0
by: BornTOCode | last post by:
Hello, I am attempting to call a (Delphi) win32 DLL from a Delphi.Net webservice. I am using a slightly modified version of the hello world webservice that comes with Delphi 2006. The DLL...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.