Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
we enter the values in text field that values come to my mail id using any of these no problem.i am trying what ever i got in internet but its not working. plse give me end to end solution...........
Posted
Updated 3-Apr-15 23:14pm
v2

1 solution

Sadly, you can send emails using PHP[^] only.

PHP
// Code from link attached

$to      = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com';

// send email
mail($to, $subject, $message, $headers);
?>


jQuery or JavaScript can only send an ajax request[^] to your PHP based server to send email.

JavaScript
$.ajax({
   // URL where your PHP code is
   url: 'send-email.php'
   // if sent
   success: function(data) {
     alert('Email sent');
   }
});


I believe this would be enough!
 
Share this answer
 
v2
Comments
Member 11565624 6-Apr-15 3:43am    
i tried this one also but its not working
Member 11565624 6-Apr-15 3:43am    
my question is how to send textfield values to my mail?
Afzaal Ahmad Zeeshan 6-Apr-15 20:59pm    
Just simply pass those as variables in the mail function.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900