Jump to content

Check this mail sending script


veluit06

Recommended Posts

hi i write one mail sending script in php, it dntknow its not coming plz check my coding and help me

 

<----Html coding--->

<input name="txtEmail" type="text" id="txtEmail"  onchange="dooperation('Submit')" />

 

<----Ajax and value passing script---->

 

// JavaScript Document

//Comm AJEX Code//

 

function GetXmlHttpObject()

{

var xmlHttp=null;

try

  {

  // Firefox, Opera 8.0+, Safari

  xmlHttp=new XMLHttpRequest();

  }

catch (e)

  {

  // Internet Explorer

  try

    {

    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");

    }

  catch (e)

    {

    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");

    }

  }

return xmlHttp;

}

 

 

 

 

//Save Client Detials//

function saveFeedback()

{

 

var cEmail = document.getElementById('txtEmail').value;

 

 

xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)

{

alert ("Your browser does not support AJAX!");

return;

}

var url="mailrec.php";

url=url+"?&email="+cEmail;

xmlHttp.onreadystatechange=stateChangedclientDet;

xmlHttp.open("GET",url,true);

xmlHttp.send(null);

}

 

function stateChangedclientDet()

{

if (xmlHttp.readyState==2)

{

document.getElementById("lblStatusMsg").innerHTML="Processing.....";

}

else{}

 

if (xmlHttp.readyState==4)

{

  document.getElementById("lblStatusMsg").innerHTML=xmlHttp.responseText;

  alert (xmlHttp.responseText);

}

else{}

}

//End of Save Student Detials////

 

//operations/////

function dooperation(opr)

{

if (opr == 'Submit')

{

saveFeedback();

}

else{}

}

 

//End Operations/////////

 

<--------PHP Script-------->

 

<?PHP

 

$email = $_GET['email'];

 

$to = "veluit06@gmail.com";

$subject = "Email Id";

$body = "Email " . $email . "\n" ;

 

 

if (mail($to, $subject, $body)) {

  echo("Message successfully sent!");

} else {

  echo("Message delivery failed...");

}

 

?>

 

 

 

Link to comment
Share on other sites

hi friend

i tried with from also, actually one text box and button,

inside the textbox am using onchange event, using onchange event i receiving textbox values to my id, after clicking button confirmation message is sent to email entered person,

everything working fine but textbox value is not coming.........

Link to comment
Share on other sites

this script aren't should use AJAX.. well..

to be honest

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

in my own script.. this are failed ???

 

but when i type this

 

$stat=mail($mailto,$mailsbj,$mailmsg, $headers);

 

it work?

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.