Jump to content

PHP Mail sending script


veluit06

Recommended Posts

Hi

 

i create one text field (email Id text box) and submit button, when User entered his/her email id after submitting, they receive one message "welcome" like that at the same time i also want to receive there mail id. below i pasted my script, after submitting mail sending part is working, at the same time i also want to receive my user mail id plz help me friends

 

Html Code:

 

<form name="submitEmail" onsubmit="return checkMailId(submitEmail.txtEmail.value)" action="sentmail.php" method="post">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="right"><a href="#" class="semiBlackClose" onclick="hideSemiBlack();">Close</a></td>
  </tr>
  <tr>
    <td><strong>Please, Enter Your Email Id below to download the Antivirus Products at No Cost </strong></td>
  </tr>
   <tr>
    <td> </td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="31%" align="center"><strong>Email Id</strong> </td>
            <td width="69%"><input name="txtEmail" type="text" id="txtEmail" /></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td align="center"> </td>
      </tr>
      <tr>
        <td align="center"><input name="btnSubmit" type="submit" id="btnSubmit" value="Submit" /></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td> </td>
  </tr>
</table>
</form>

 

PHP Code:

 

<?PHP

$from = "Kickvirus";
$to = $_REQUEST['txtEmail'];
$subject = "Suggested By KickVirus";
$body = "Hi \n Click this Link For Confirm Your Email Id \n http://www.mittaai.com/survey/replymail.php";
$headers = "From: $from";

if (mail($to, $subject, $body, $headers)) {
  //echo("Message successfully sent!");
} else {
  echo("Message delivery failed...");
}

?>

Link to comment
https://forums.phpfreaks.com/topic/142929-php-mail-sending-script/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.