Total Pageviews

Tuesday, April 19, 2011

sending multiple emails in php



<php
if(isset($_REQUEST['submit']))
{
//$toadd = $_REQUEST['to'];
//define the receiver of the email
$to = $_REQUEST['to'];

$array = explode(",", $to);

foreach ($array as $k => $v)
{
    $ids= explode(",", $v);
    //echo "  ". $ids[0];
if($ids!="")
{

      if (!preg_match("/^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$/i", $ids[0]))
      {
      echo "<font color='red'>something is Invalid email id's </font>";
       }
     else{
      echo "<font color='green'> Valid Email id's </font>";
 }

}
}
//define the subject of the email
$subject = 'Test email';
//define the message to be sent. Each line should be separated with \n
$message = "Hello World!\n\nThis is my first mail.";
//define the headers we want passed. Note that they are separated with \r\n
$headers = "From: k.v.n.krishnakumar@gmail.com\r\nReply-To:  k.v.n.krishnakumar@gmail.com";
//send the email
$mail_sent = @mail( $ids[0], $subject, $message, $headers );
//if the message is sent successfully print "Mail sent". Otherwise print "Mail failed"
echo $mail_sent ? "You have referred the following your friend email id's:'  $ids[0]' " : "Referral sending failed to:'$to' this id";
}

?>


<form method="post" action="referfndmail.php">
Invite Friends Here : <input type="text" name="to" onBlur="AjaxFunction(this.value);"><div id="msg"></div>
<input type="submit" name="submit" value="Invite" />

<form>

Friday, April 15, 2011

ajax php email validation




check tis image to ajax php email validation

Ajax using php email validation


put this script on html head.....

div class='k'> Type input. Rule:type email formate only.
type ur email here << input type="text" onkeyup= prompt(this.value)" size="20" />
Prompt: /div>
the above is a html form.....save any name .htm or phpand php code is
$z=$_GET["q"];echo $z;if (!preg_match("/^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$/i", $z)){echo still Invalid email";}else{echo Valid Email";} ?>
the abvoe is the expresstion match via php save this file has filter.php