Hi guys thanks for the reply.....
the contact form code is.....
<form name="htmlform" method="post" action="">
<table width="450px">
<tr>
<td valign="top">
<label for="first_name">Name *</label>
</td>
<td valign="top">
<input type="text" name="first_name" maxlength="50" size="30"/>
</td>
</tr>
<tr>
<td valign="top">
<label for="email">Email Address *</label>
</td>
<td valign="top">
<input type="text" name="email" maxlength="50" size="30"/>
</td>
</tr>
<tr>
<td valign="top">
<label for="telephone">Telephone Number</label>
</td>
<td valign="top">
<input type="text" name="telephone" maxlength="50" size="30"/>
</td>
</tr>
<tr>
<td valign="top">
<label for="comments"> Your message *</label>
</td>
<td valign="top">
<textarea name="comments" maxlength="1000" cols="35" rows="6"></textarea>
</td>
</tr>
<tr>
<td colspan="2" style="text-align:center">
<input type="submit" value="Submit"/>
</td>
</tr>
</table>
</form>
and the php file is.......
<?php
$smtp_host = "mail.your domain.com";
$smtp_user = "
[email protected]";
$smtp_password = "xxxxxxxxxxxx";
$smtp_port = "25";
/*$smtp_ssl = "False";*/
/*$smtp_ssl = "True";*/
$mail_from = "
[email protected]";
$mail_from_name = "RDS Support";
$mail_to = "
[email protected]";
$mail_to_name = "RDS Support";
?>
<html>
<head>
<title>PHPMailer - SMTP basic test with authentication</title>
</head>
<body>
<?php
//error_reporting(E_ALL);
error_reporting(E_STRICT);
date_default_timezone_set('Asia/Kolkata');
require_once('class.phpmailer.php');
// include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
$mail = new PHPMailer();
//$body = file_get_contents('contents.html');
//$body = preg_replace('/[\]/','',$body);
$body = 'Test';
echo $body;
echo "---";
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "{$smtp_host}"; // SMTP server
$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
// 1 = errors and messages
// 2 = messages only
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Host = "{$smtp_host}"; // sets the SMTP server
$mail->Port = $smtp_port; // set the SMTP port for the GMAIL server
$mail->Username = "{$smtp_user}"; // SMTP account username
$mail->Password = "{$smtp_password}"; // SMTP account password
$mail->SetFrom("{$mail_from}", "{$mail_from_name}");
$mail->AddReplyTo("{$mail_from}", "{$mail_from_name}");
$mail->Subject = "PHPMailer Test Subject via smtp, basic with authentication";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->MsgHTML($body);
$address = "{$mail_to}";
$mail->AddAddress($address, "{$mail_to_name}" );
//$mail->AddAttachment("images/phpmailer.gif"); // attachment
//$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
?>
</body>
</html>