Jump to content

Problem - PHP-sending data to my mail id


vjn_23

Recommended Posts

Hi Friends,

 

I did one contact.php and process.php(also i attached txt file). This process.php file send the data to my yahoo mail id.

 

But i didnt receive any mails from this page. I dont know what i did the mistaken.

 

so pls kindly send me you suggestion or feedback. waiting for your valuable suggestion.

 

contact.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>testing - Contact Page</title>
</head>

<body>
<form name="contact" method="POST" action="process.php">
<table width="456" border="0" cellpadding="0" cellspacing="0">
   <tr>
      <td height="28" valign="top">Your name:</td>
      <td><input name="name" type="text"></td>
   </tr>
   <tr>
      <td height="28" valign="top">E-mail address:</td>
      <td><input name="email" type="text"></td>
   </tr>
   <tr>
      <td height="28" valign="top">Contact No:</td>
      <td><input name="contact" type="text"></td>
   </tr>
   <tr>
      <td height="28" valign="top">Message:</td>
      <td><input name="message" type="text" /></td>
   </tr>
   <tr>
      <td> </td>
      <td valign="top" align="center"><input type="submit" value="Submit" name="submit"></td>
   </tr>
</table>
</form>
</body>
</html>

 

 

process.php

<?php
if(isset($_POST['submit'])) {
   $to = 'vjn_23@yahoo.co.in';     //put your email address on which you want to receive the information
   $subject = 'hello';   //set the subject of email.
   
   $headers = 'MIME-Version: 1.0' . "\r\n".
		'Content-type: text/html; charset=utf-8' . "\r\n".
		'From: vijay@telltales.in' . "\r\n" .
		'Reply-To: vijay@telltales.in' . "\r\n" .
		'X-Mailer: PHP/' . phpversion();
   
   $message = "<table><tr><td>Your Name</td><td>".$_POST['name']."</td></tr>
               <tr><td>E-Mail</td><td>".$_POST['email']."</td></tr>
               <tr><td>Contact No</td><td>".$_POST['contact']."</td></tr>
               <tr><td>Message</td><td>".$_POST['message']."</td>
               </tr></table>" ;
		   
   mail($to, $subject, $message, $headers);
   header('Location: contact.php');
}
?>

 

 

Thank U,

vjn_23

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.