473,387 Members | 1,611 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,387 software developers and data experts.

php mail function

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. //print_r($_REQUEST);
  3. $link = mysql_connect('localhost', 'root', '');
  4. if (!$link) {
  5.     die('Could not connect: ' . mysql_error());
  6. }
  7. mysql_select_db("moes", $link);
  8. $confirm_code=    md5(uniqid(rand()));
  9. $fname=$_POST['First_Name'];
  10. $lname=$_POST['Last_Name'];
  11. $address=$_POST['Address'];
  12. $country=$_POST['Country'];
  13. $state=$_POST['State'];
  14. $city=$_POST['City'];
  15. $pincode=$_POST['Pincode'];
  16. $cnumber=$_POST['Contactno'];
  17. $gender=$_POST['Gender'];
  18. $birthday=$_POST['Year'].'-'.$_POST['Month'].'-'.$_POST['Day'];
  19. $email=$_POST['Email_Id'];
  20. $password1=$_POST['Password1']; 
  21. $encrypted_mypassword1=md5($password1);
  22. $password2=$_POST['Password2'];
  23. $encrypted_mypassword2=md5($password2);
  24. $query="INSERT INTO user_registration(first_name,last_name,address,city,state,pincode,country,contact_number,gender,date_of_birth,email_id,password1,password2) VALUES ('$fname','$lname','$address','$city','$state','$pincode','$country','$cnumber','$gender','$birthday','$email','$encrypted_mypassword1','$encrypted_mypassword2')";
  25. $success=mysql_query($query, $link);
  26.  
  27. if($success) {
  28.     $to = $email;
  29.     $subject = 'Confirm your account with MOES';
  30.     $message="Your Comfirmation link \r\n";
  31. //    $message.="Click on this link to activate your account \r\n";
  32.     //$message.="http://www.example.com/confirmation.php?passkey=$confirm_code";
  33.     $headers = "From: sender@yourdomain.com rn";
  34.     $sentmail=mail($to,$subject,$message,$header);
  35. }
  36.  
  37. if($sentmail)
  38. {
  39.     echo "your confirmaiton link has been send to your account";
  40.     $header = 'Location: http://localhost/client/thankyou.php';
  41.  
  42. }
  43.  
  44. else {
  45.     echo "can not send confirmation link to your account";
  46. }
  47. ?>
i have this kind of code any one can help me why i get the error
Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\xampp\htdocs\clientc\action.php on line 34
can not send confirmation link to your account
Apr 19 '12 #1
2 1593
johny10151981
1,059 1GB
it mean open your php.ini and setup your send mail options
Apr 19 '12 #2
$headers = "From: sender@yourdomain.com rn";

$sentmail=mail($to,$subject,$message,$header);

you r missing s

$sentmail=mail($to,$subject,$message,$headers);
Apr 26 '12 #3

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

Similar topics

1
by: haref | last post by:
hi ng, what can i do in the following mail function, which hast 400 subscribers who are read from a database and to which the mails are send in a loop, when there are some adresses who are not...
1
by: haref | last post by:
hi ng, what can i do in the following mail function, which hast 400 subscribers who are read from a database and to which the mails are send in a loop, when there are some adresses who are not...
7
by: Jim Seymour | last post by:
I have a contact form that uses PHP's mail() function. It recently came to my attention that (some?) MS-Windows mail servers may not properly process data given to the mail() function that's only...
2
by: Groupe Eurower | last post by:
Hi, I would like contribute to the PHP development but i don't really know where i can submit my codes ! In fact, i'm a Web Hosting and i authorize the utilisation of the mail() function. ...
2
by: Bandul | last post by:
Hi everyone I am trying to send a e-mail using the mail() function. Now i try to send more than one data from mysql database so i must use example $results=mysql_num_rows($result_query)...
13
Nert
by: Nert | last post by:
hello every one, i need help.. how can i use the mail() funtion in php? when ever i execute the mail function i continuesly receive this error message: what do i need to do in order for me...
9
by: shror | last post by:
hi every body, i have a problem which is when i was checking my mail() form it work fine but the problem is that the form configuration is not set correctly, in details: the from var is not...
1
by: Abersparky | last post by:
Can someone help me with the mail() function??? The below is just to get myself going but I can't seem to get it working... is there something else I should be doing? I checked phpinfo() and the...
2
by: empiresolutions | last post by:
I am using a standard mail function within an AMFPHP Class that i have used many times. Now, when i use it it does not work right. When a mail is sent, the $header info and html shows in the email. ...
3
by: swethak | last post by:
hi, i used the below mentioned code mail function didn't work.that means it didn't give any error and also mail didn't receive.plz tell that what's the mistake and my php.ini contains ;...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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
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,...

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.