Jump to content

html feedback form with feedback php script


bakul_kaushik

Recommended Posts

hi everybody,

my feedback form is not working. mails are not received to the given address. i have used html and for server side i have used php. Please help!!

 

The code is for feedback.php :--

<?php

 

 

// ------------- CONFIGURABLE SECTION ------------------------

 

// $mailto - set to the email address you want the form

// sent to, eg

//$mailto = "[email protected]" ;

 

$mailto = '[email protected],[email protected]' ;

 

// $subject - set to the Subject line of the email, eg

//$subject = "Feedback Form" ;

 

$subject = "Feedback" ;

 

 

$formurl = "http://www.benaka.in/Feedback.html" ;

$errorurl = "http://www.benaka.in/error.html" ;

$thankyouurl = "http://www.benaka.in/index.html" ;

 

$email_is_required = 1;

$name_is_required = 1;

$comments_is_required = 1;

$mobile_is_required = 0;

$hear_is_required=0;

$address_is_required = 0;

$uself = 1;

$use_envsender = 0;

$use_sendmailfrom = 1;

$use_webmaster_email_for_from = 0;

$use_utf8 = 1;

$my_recaptcha_private_key = '' ;

 

// -------------------- END OF CONFIGURABLE SECTION ---------------

 

$headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ;

$content_type = (!isset( $use_utf8 ) || ($use_utf8 == 0)) ? 'Content-Type: text/plain; charset="iso-8859-1"' : 'Content-Type: text/plain; charset="utf-8"' ;

if (!isset( $use_envsender )) { $use_envsender = 0 ; }

if (isset( $use_sendmailfrom ) && $use_sendmailfrom) {

ini_set( 'sendmail_from', $mailto );

}

$envsender = "-f$mailto" ;

$fullname = (isset($_POST['fullname']))? $_POST['fullname'] : $_POST['name'] ;

$email = $_POST['email'] ;

$hear=$_POST['hear'];

$mobile = $_POST['mobile'];

$address = $_POST['address'];

$comments = $_POST['comments'] ;

$http_referrer = getenv( "HTTP_REFERER" );

 

if (!isset($_POST['email'])) {

header( "Location: $formurl" );

exit ;

}

if (($email_is_required && (empty($email) || !preg_match('/@/', $email))) || ($name_is_required && empty($fullname)) || ($comments_is_required && empty($comments))) {

header( "Location: $errorurl" );

exit ;

}

if ( preg_match( "/[\r\n]/", $fullname ) || preg_match( "/[\r\n]/", $email ) ) {

header( "Location: $errorurl" );

exit ;

}

if (strlen( $my_recaptcha_private_key )) {

require_once( 'recaptchalib.php' );

$resp = recaptcha_check_answer ( $my_recaptcha_private_key, $_SERVER['REMOTE_ADDR'], $_POST['recaptcha_challenge_field'], $_POST['recaptcha_response_field'] );

if (!$resp->is_valid) {

header( "Location: $errorurl" );

exit ;

}

}

if (empty($email)) {

$email = $mailto ;

}

$fromemail = (!isset( $use_webmaster_email_for_from ) || ($use_webmaster_email_for_from == 0)) ? $email : $mailto ;

 

if (function_exists( 'get_magic_quotes_gpc' ) && get_magic_quotes_gpc()) {

$comments = stripslashes( $comments );

}

 

$messageproper =

"This message was sent from:\n" .

"$http_referrer\n" .

"------------------------------------------------------------\n" .

"Name of sender: $fullname\n" .

"Email of sender: $email\n" .

"Contact no of sender : $mobile\n" .

"Address of sender : $address\n" .

"How did you hear about this website : $hear\n" .

"------------------------- Feedback -------------------------\n\n" .

$comments .

"\n\n------------------------------------------------------------\n" ;

 

$headers =

"From: \"$fullname\" <$fromemail>" . $headersep . "Reply-To: \"$fullname\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.15.0" .

$headersep . 'MIME-Version: 1.0' . $headersep . $content_type ;

 

if ($use_envsender) {

mail($mailto, $subject, $messageproper, $headers, $envsender );

}

else {

mail($mailto, $subject, $messageproper, $headers );

}

header( "Location: $thankyouurl" );

exit ;

 

?>

 

 

 

 

 

 

 

 

 

 

the html form is :---

<!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=iso-8859-1" />

<title>B E N A K A Business Consultancy</title>

<link href="images/links.css" rel="stylesheet" type="text/css" />

<style type="text/css">

<!--

.style1 { color: #88B2E2;

font-weight: bold;

}

.style8 {

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 9px;

}

.style11 {font-size: 12px}

.style14 {font-family: Verdana, Arial, Helvetica, sans-serif}

.style19 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; }

.style21 {color: #B93131}

.style23 {color: #B93131; font-weight: bold; }

.style25 {color: #646464; font-size: 10px;}

-->

</style>

<script language="JavaScript">

<!--

function mmLoadMenus() {

if (window.mm_menu_0101000743_0) return;

window.mm_menu_0101000743_0 = new Menu("root",131,17,"Arial, Helvetica, sans-serif",11,"#FFFFFF","#FFFFFF","#6591DA","#1E1E2B","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);

mm_menu_0101000743_0.addMenuItem("Our Vision","location='Our Vision.html'");

mm_menu_0101000743_0.addMenuItem("Our Mission","location='Our Mission.html'");

mm_menu_0101000743_0.addMenuItem("Our Values","location='Our Values.html'");

mm_menu_0101000743_0.addMenuItem("Our Methodology","location='Our Methodology.html'");

mm_menu_0101000743_0.addMenuItem("Our Approach","location='Our Approach.html'");

mm_menu_0101000743_0.addMenuItem("Our Management","location='Our Management.html'");

mm_menu_0101000743_0.fontWeight="bold";

mm_menu_0101000743_0.hideOnMouseOut=true;

mm_menu_0101000743_0.bgColor='#FFFFFF';

mm_menu_0101000743_0.menuBorder=0;

mm_menu_0101000743_0.menuLiteBgColor='#FFFFFF';

mm_menu_0101000743_0.menuBorderBgColor='#FFFFFF';

 

window.mm_menu_0101001508_0_1 = new Menu("Business Consultancy",145,17,"Arial, Helvetica, sans-serif",11,"#FFFFFF","#FFFFFF","#6591DA","#1E1E2B","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);

mm_menu_0101001508_0_1.addMenuItem("Business Incubation ","location='Business Incubation.html '");

mm_menu_0101001508_0_1.addMenuItem("Mentorship","location='Mentorship.html '");

mm_menu_0101001508_0_1.fontWeight="bold";

mm_menu_0101001508_0_1.hideOnMouseOut=true;

mm_menu_0101001508_0_1.bgColor='#FFFFFF';

mm_menu_0101001508_0_1.menuBorder=0;

mm_menu_0101001508_0_1.menuLiteBgColor='#FFFFFF';

mm_menu_0101001508_0_1.menuBorderBgColor='#FFFFFF';

window.mm_menu_0101001508_0_2 = new Menu("Marketing Consultancy",137,17,"Arial, Helvetica, sans-serif",11,"#FFFFFF","#FFFFFF","#6591DA","#1E1E2B","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);

mm_menu_0101001508_0_2.addMenuItem("Brand Consultancy","location='Brand Consultancy.html'");

mm_menu_0101001508_0_2.addMenuItem("Corporate Identity","location='Corporate Identity.html'");

mm_menu_0101001508_0_2.fontWeight="bold";

mm_menu_0101001508_0_2.hideOnMouseOut=true;

mm_menu_0101001508_0_2.bgColor='#FFFFFF';

mm_menu_0101001508_0_2.menuBorder=0;

mm_menu_0101001508_0_2.menuLiteBgColor='#FFFFFF';

mm_menu_0101001508_0_2.menuBorderBgColor='#FFFFFF';

window.mm_menu_0101001508_0_3 = new Menu("Website Consultancy",156,17,"Arial, Helvetica, sans-serif",11,"#FFFFFF","#FFFFFF","#6591DA","#1E1E2B","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);

mm_menu_0101001508_0_3.addMenuItem("Website Development","location='Website Development.html'");

mm_menu_0101001508_0_3.addMenuItem("Website redesign","location='Website redesign.html'");

mm_menu_0101001508_0_3.addMenuItem("Flash Development","location='Flash Development.html'");

mm_menu_0101001508_0_3.addMenuItem("SEO Services","location='SEO Services.html'");

mm_menu_0101001508_0_3.fontWeight="bold";

mm_menu_0101001508_0_3.hideOnMouseOut=true;

mm_menu_0101001508_0_3.bgColor='#FFFFFF';

mm_menu_0101001508_0_3.menuBorder=0;

mm_menu_0101001508_0_3.menuLiteBgColor='#FFFFFF';

mm_menu_0101001508_0_3.menuBorderBgColor='#FFFFFF';

window.mm_menu_0101001508_0_4 = new Menu("E commerce Cunsultancy",163,17,"Arial, Helvetica, sans-serif",11,"#FFFFFF","#FFFFFF","#6591DA","#1E1E2B","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);

mm_menu_0101001508_0_4.addMenuItem(" E commerce solutions","location=' E commerce solutions.html'");

mm_menu_0101001508_0_4.addMenuItem("Shopping Cart Solution","location='Shopping Cart Solution.html'");

mm_menu_0101001508_0_4.addMenuItem("Payment Gateways","location='Payment Gateways.html'");

mm_menu_0101001508_0_4.fontWeight="bold";

mm_menu_0101001508_0_4.hideOnMouseOut=true;

mm_menu_0101001508_0_4.bgColor='#FFFFFF';

mm_menu_0101001508_0_4.menuBorder=0;

mm_menu_0101001508_0_4.menuLiteBgColor='#FFFFFF';

mm_menu_0101001508_0_4.menuBorderBgColor='#FFFFFF';

window.mm_menu_0101001508_0 = new Menu("root",186,17,"Arial, Helvetica, sans-serif",11,"#FFFFFF","#FFFFFF","#6591DA","#1E1E2B","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);

mm_menu_0101001508_0.addMenuItem(mm_menu_0101001508_0_1,"location='Business Consultancy.html'");

mm_menu_0101001508_0.addMenuItem("Technology Consultancy","location='Technology Consultancy.html'");

mm_menu_0101001508_0.addMenuItem("Finance Consultancy","location=' Finance Consultancy.html'");

mm_menu_0101001508_0.addMenuItem(mm_menu_0101001508_0_2,"location='Marketing Consultancy.html'");

mm_menu_0101001508_0.addMenuItem("Organizational Consultancy","location='Organizational Consultancy.html'");

mm_menu_0101001508_0.addMenuItem(mm_menu_0101001508_0_3,"location='Website Consultancy.html'");

mm_menu_0101001508_0.addMenuItem(mm_menu_0101001508_0_4,"location='E commerce Consultancy.html'");

mm_menu_0101001508_0.addMenuItem("Maintenance and Support","location='Maintenance and Support.html'");

mm_menu_0101001508_0.fontWeight="bold";

mm_menu_0101001508_0.hideOnMouseOut=true;

mm_menu_0101001508_0.childMenuIcon="arrows.gif";

mm_menu_0101001508_0.bgColor='#FFFFFF';

mm_menu_0101001508_0.menuBorder=0;

mm_menu_0101001508_0.menuLiteBgColor='#FFFFFF';

mm_menu_0101001508_0.menuBorderBgColor='#FFFFFF';

window.mm_menu_0101002612_0 = new Menu("root",136,17,"Arial, Helvetica, sans-serif",11,"#FFFFFF","#FFFFFF","#6591DA","#1E1E2B","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);

mm_menu_0101002612_0.addMenuItem("Why Join Benaka?","location='whybenaka.html'");

mm_menu_0101002612_0.addMenuItem("Work Culture","location='Work Culture.html'");

mm_menu_0101002612_0.addMenuItem("Opportunities","location='Opportunities.html'");

mm_menu_0101002612_0.addMenuItem("Skill sets","location=' Skill sets.html'");

mm_menu_0101002612_0.fontWeight="bold";

mm_menu_0101002612_0.hideOnMouseOut=true;

mm_menu_0101002612_0.bgColor='#FFFFFF';

mm_menu_0101002612_0.menuBorder=0;

mm_menu_0101002612_0.menuLiteBgColor='#FFFFFF';

mm_menu_0101002612_0.menuBorderBgColor='#FFFFFF';

window.mm_menu_0101002726_0 = new Menu("root",104,17,"Arial, Helvetica, sans-serif",11,"#FFFFFF","#FFFFFF","#6591DA","#1E1E2B","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);

mm_menu_0101002726_0.addMenuItem("Liability","location='Liability.html'");

mm_menu_0101002726_0.addMenuItem("Disclaimer","location='Disclaimer.html'");

mm_menu_0101002726_0.addMenuItem("Data Security","location='Data Security.html'");

mm_menu_0101002726_0.fontWeight="bold";

mm_menu_0101002726_0.hideOnMouseOut=true;

mm_menu_0101002726_0.bgColor='#FFFFFF';

mm_menu_0101002726_0.menuBorder=0;

mm_menu_0101002726_0.menuLiteBgColor='#FFFFFF';

mm_menu_0101002726_0.menuBorderBgColor='#FFFFFF';

 

window.mm_menu_0101003658_0 = new Menu("root",83,17,"Arial, Helvetica, sans-serif",11,"#FFFFFF","#FFFFFF","#6591DA","#1E1E2B","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);

mm_menu_0101003658_0.addMenuItem("Feedback","location='feedback.html'");

mm_menu_0101003658_0.fontWeight="bold";

mm_menu_0101003658_0.hideOnMouseOut=true;

mm_menu_0101003658_0.bgColor='#FFFFFF';

mm_menu_0101003658_0.menuBorder=0;

mm_menu_0101003658_0.menuLiteBgColor='#FFFFFF';

mm_menu_0101003658_0.menuBorderBgColor='#FFFFFF';

 

mm_menu_0101003658_0.writeMenus();

} // mmLoadMenus()

//-->

</script>

<script language="JavaScript" src="mm_menu.js"></script>

</head>

 

<body>

<script language="JavaScript1.2">mmLoadMenus();</script>

<table width="100%" height="632" border="0" cellpadding="0" cellspacing="0">

<tr>

<td width="33%" rowspan="2" valign="top"><img src="images/logo.jpg" width="330" height="58" /></td>

<td width="67%" height="30"><div align="right"><span class="style14"><span class="link"><a href="index.html" class="b">Home</a> </span><span class="b"> <img src="../html_pject/images/dot_bar.jpg" width="1" height="12" />  <a href="sitemap.html" class="b">Sitemap</a>  <img src="../html_pject/images/dot_bar.jpg" width="1" height="12" />  <a href="Opportunities.html" class="b">Careers</a>  <img src="../html_pject/images/dot_bar.jpg" width="1" height="12" />   <a href="Contact Us.html" class="b">Contact us</a></span></span></div></td>

</tr>

<tr>

<td height="19"> </td>

</tr>

<tr>

<td height="84" colspan="2"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="990" height="155">

<param name="movie" value="images/index.swf" />

<param name="quality" value="high" />

<embed src="images/index.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="990" height="155"></embed>

</object></td>

</tr>

<tr>

<td height="21" colspan="2" bgcolor="#3D70BC"><span class="link">                                                       </span><span class="link">           <img src="images/arrow.png" width="6" height="5" />  <a href="About us.html" name="link2" class="link" id="link1" onmouseover="MM_showMenu(window.mm_menu_0101000743_0,0,15,null,'link2')" onmouseout="MM_startTimeout();">About us</a> </span>      <span class="link"><img src="images/arrow.png" width="6" height="5" /></span> <span class="link"><a href="Our Services.html" name="link7" class="link" id="link3" onmouseover="MM_showMenu(window.mm_menu_0101001508_0,0,15,null,'link7')" onmouseout="MM_startTimeout();">Our Services</a></span>      <span class="link"><img src="images/arrow.png" width="6" height="5" /></span>  <span class="link"><a href="Our people.html" name="link8" class="link" id="link5" onmouseover="MM_showMenu(window.mm_menu_0101002612_0,0,15,null,'link8')" onmouseout="MM_startTimeout();">Our People</a></span><a href="Our people.html"></a>     <span class="link"><img src="images/arrow.png" width="6" height="5" /></span>  <span class="link"><a href="contact us.html" name="link9" class="link" id="link6" onmouseover="MM_showMenu(window.mm_menu_0101003658_0,0,15,null,'link9')" onmouseout="MM_startTimeout();">Contact Us</a></span> </td>

</tr>

<tr>

<td height="356" colspan="2"><table width="100%" height="318" border="0" cellpadding="3" cellspacing="4">

<tr>

<td width="22%" height="318" align="left" valign="top">

<table width="98%" height="254" border="0" cellpadding="2" cellspacing="1" bgcolor="#C1D3FB">

<tr>

<td height="252" align="center" valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td height="264" align="left" valign="top"><p class="style19">Privacy</p>

<p class="style8">Benaka respects your privacy and takes comprehensive measures to safeguard your personal and business information. We will not share your credentials and business data with any     third parties without your permission.<br />

<br />

Multi-levelcorporate security policiesand procedures ensure prevention from loss, misuse or unauthorized distribution of any business-sensitive information you share with us. </p></td>

</tr>

</table></td>

</tr>

</table>

<p class="style19"> </p>

<p class="style19"> </p>

<span class="text"></span><br /></td><td width="54%" valign="top" class="content"><table width="100%" height="22" border="0" cellpadding="0" cellspacing="0" bgcolor="#EAEAEA">

<tr>

<td class="sitemap">  &#8212;><a href="Contact Us.html" class="sitemap">Contact Us</a>  &#8212;><a href="Feedback.html" class="sitemap">Feedback</a></td>

</tr>

</table>

<div align="justify" class="text">

<table width="103%" height="24" border="0.5" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" bgcolor="#B9D8FD">

<tr>

<td width="1%" height="24" valign="top" bgcolor="#7D99DB"></td>

<td width="99%" valign="middle" bgcolor="#CDE8F8"><span class="style1">  </span><strong class="style6">FEEDBACK</strong></td>

</tr>

</table><form action="feedback.php" method="post">

<table width="100%" border="0" cellspacing="0" cellpadding="4">

<tr>

<td width="4%" height="206" class="text"><p class="style8"> </p>

</td>

<td width="96%" valign="top"><p>If you have a sound understanding in consultancy business, please feel free to give your valuable feedback or suggestion. This will help us to improve our quality of service and also understand our customers’ expectations in a better manner; finally you will get an attractive gift if you have given the best suggestion! Please visit all the web pages of <a href="http://www.benaka.in">www.benaka.in</a> and communicate us by phone or e-mail <a href="mailto:[email protected]">[email protected]</a> or write to us directly. </p>

<table width="99%" border="0" cellspacing="4" cellpadding="5">

<!--DWLayoutTable-->

<tr>

<td width="220"><span class="style11"><span class="style21">* </span>

<label for="tswname">Your Name :</label></span></td>

<td width="144"><input name="name" type="text" id="tswname" size="30" /></td>

</tr>

<tr>

<td width="220"><span class="style11"><span class="style21">* </span>

<label for="tswaddress">Contact Address : </label></span></td>

<td><input name="address" type="text" size="30" id="tswaddress" /></td>

</tr>

<tr>

<td width="220"><span class="style21">* </span>

<label for="tswmobile">Phone Number :</label></td>

<td><input name="mobile" type="text" size="30" id="tswmobile" /></td>

</tr>

<tr>

<td width="220"><span class="style21">* </span>

<label for="tswemail">Your current E-Mail Id :</label></td>

<td><input name="email" type="text" size="30" id="tswemail" /></td>

</tr>

<tr>

<td width="220" class="style11"><span class="style21">* </span>

<label for="tswhear">How did you hear about this website?:</label></td>

<td>

<input name="hear" type="text" size="30" id="tswehear" />

</td>

</tr>

<tr>

<td width="220" height="32" valign="top" class="style11"><span class="style21">* </span>

<label for="tswcomments">Feedback :</label></td>

<td height="32" valign="top" class="style11"><textarea name="comments" id="tswcomments" cols="23" rows="4"></textarea></td>

</tr>

<tr>

<td height="92" colspan="2" valign="top" class="style11"><br />

<br />

<label>                                                                      

<input name="submit" type="submit" value="Submit" />

         </label>

<input name="reset" type="reset" value="Reset" />

<br />

<br />

<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td bgcolor="#EBF4FE"><span class="style23">* </span><span class="style25">Mandatory Fields </span></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

</table></form>

<p> </p>

</td>

<td width="24%" align="center" valign="top" class="content"><table width="217" height="136" border="0.5" cellpadding="2" cellspacing="1">

<tr>

<td width="211" height="134" valign="top" bgcolor="#FFFFFF"><img src="images/3_itm.jpg" width="209" height="130" border="0" usemap="#Map" />

<map name="Map" id="Map3">

<area shape="rect" coords="16,20,192,45" href="RFI.html" />

<area shape="rect" coords="15,54,192,83" href="CMB.html" />

<area shape="rect" coords="15,92,192,121" href="GFE.html" />

</map></td>

</tr>

</table>

<table width="209" height="136" border="0.5" cellpadding="2" cellspacing="1" bordercolor="#C8D8FB" bgcolor="#C6D6FD">

<tr>

<td width="203" height="134" valign="top" bgcolor="#FFFFFF"><div align="center"><img src="images/portfolio.jpg" width="206" height="128" border="0" usemap="#Map2" />

<map name="Map2" id="Map2">

<area shape="rect" coords="8,13,193,121" href="portfolio.html" />

</map>

</div></td>

</tr>

</table></td>

</tr>

</table>

<map name="Map" id="Map">

<area shape="rect" coords="16,20,192,45" href="RFI.html" />

<area shape="rect" coords="15,54,192,83" href="CMB.html" />

<area shape="rect" coords="15,92,192,121" href="GFE" />

</map></td>

</tr>

<tr>

<td height="19" colspan="2" bgcolor="#E1ECF4"> </td>

</tr>

<tr>

<td height="19" colspan="2" bgcolor="#FFFFFF"><div align="left">

<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td width="25%"><span class="b"><a href="Privacy.html" class="b">Privacy policy</a>     All Right Reserved 2009-2010.</span></td>

<td width="45%"> </td>

<td width="30%"><div align="right"><span class="b"><a href="Liability.html" class="b">Liability</a>     <a href="Disclaimer.html" class="b">Disclaimer</a>     <a href="Data Security.html" class="b">Data Security</a> </span></div></td>

</tr>

</table>

</div></td>

</tr>

</table>

</body>

</html>

 

 

[attachment deleted by admin]

hai u checked whether the port 25 or 465 opened or not

use the option telnet hostname 25 command to see whether the port is opened or close

as i can see from my machine that both of these ports are closed on the server.

if u open these then might be it will work on.

 

if you are using some other port on the server to send the mails please check with that port also..

by default the server uses these ports only

check with this code whether the server is able to send the mails or not..

<?php

$from_name = "Chaitu";
$from_email = "[email protected]";
$to_email = "[email protected]";
$subject = "Hai";
$message = "Hai Chaitu.";

$headers = "From: ".$from_name." <".$from_email.">\r\n";
$headers .= "Reply-To: ".$from_email."\r\n";

if(mail($to_email, $subject, $message, $headers, "-f".$from_email));
{
echo "Mail Sent!";
}
else
{
echo " Unable to send the mail!";
}
?> 

 

otherwise if ur using an smtp server to send the mails then check with the below code.

<?php
require_once "Mail.php";

$from = "Chaitu <[email protected]>";
$to = "Chaitu <[email protected]>";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";

$host = "mail.example.com";
$username = "smtp_username";
$password = "smtp_password";

$headers = array ('From' => $from,
  'To' => $to,
  'Subject' => $subject);
$smtp = Mail::factory('smtp',
  array ('host' => $host,
    'auth' => true,
    'username' => $username,
    'password' => $password));

$mail = $smtp->send($to, $headers, $body);

if (PEAR::isError($mail)) {
  echo("<p>" . $mail->getMessage() . "</p>");
} else {
  echo("<p>Message successfully sent!</p>");
}
?>

 

if the smtp is an autenticated then use this code below..

 <?php
    require_once "Mail.php";

    $from = "Chaitu <[email protected]>";
    $to = "Chaitu <[email protected]>";
    $subject = "Hi!";
    $body = "Hi,\n\nHow are you?";

    $host = "ssl://mail.example.com";
    $port = "465";
    $username = "smtp_username";
    $password = "smtp_password";

    $headers = array ('From' => $from,
      'To' => $to,
      'Subject' => $subject);
    $smtp = Mail::factory('smtp',
      array ('host' => $host,
        'port' => $port,
        'auth' => true,
        'username' => $username,
        'password' => $password));

    $mail = $smtp->send($to, $headers, $body);

    if (PEAR::isError($mail)) {
      echo("<p>" . $mail->getMessage() . "</p>");
     } else {
      echo("<p>Message successfully sent!</p>");
     }
    ?>

 

i hope these would resolve the error

Okay.. thank you i will check it out...

Actually i tried with telnet, its opening on port 25 but not on 645.

But the welcome message for port 25 is referencing to some other domain :carnegie.in

I don't know what it is....Any solution or suggestion??

Thanking you again...

 

check with this software to see whether the ports are opened

coz still now when i am using telnet for the port 25 on your server

it is giving me the same response.

 

http://chaitu09986025424.blog.co.in/2009/11/18/myports-gives-you-detailed-information-on-open-ports/

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.