I am using dreamweaver version 8 and i have used sessions to transfer data from my first page to the second page, but i want to send the data to my email address using php mailer, but i am stuck because I don’t know how to use phpmailer to send it.
FIRST PAGE
<?php session_start();?>
<title>Untitled Document</title>
</head>
<body>
<form id=”form1″ name=”form1″ method=”post” action=”2.php”>
<table width=”807″ border=”0″>
<td height=”75″></td>
<td height=”28″></td>
<td>Name:</td>
<td><label>
<input name=”name” type=”text” id=”name” />
</label></td>
<td><label>
<input type=”submit” name=”Submit” value=”Submit” />
</label></td>
</tr>
<tr>
<td height=”106″></td>
<td height=”110″></td>
</table>
</form>
</body>
</html>
2ND PAGE
<?php session_start();
$_SESSION[‘sessname’] = $
?>
<body>
<form id=”form1″ name=”form1″ method=”post” action=”sendmail4.php”>
<table width=”644″ border=”0″>
<td>Message</td>
<td><label>
<textarea name=”message” id=”message”></textarea>
</label></td>
<td><a href=”3.php”>
<label>
<input type=”submit” name=”Submit” value=”Submit” />
</label>
</table>
</form>
</body>
</html>
SENDMAIL
<?php session_start(); ?>
<?php
$name=$_SESSION([‘sessname’]);
$message=$
require ‘PHPMailer-master/PHPMailerAutoload.php’;
$mail = new PHPMailer();
$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = “mail.mydomainname.com”; // specify main and backup server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = “
$mail->Password = “12345678”; // SMTP password
$mail->From = “
$mail->FromName = “mydomainname.com”;
$mail->AddAddress(“
$mail->WordWrap = 50; // set word wrap to 50 characters
$mail->Subject = “message enquiry”;
$mail->Body = “Name: $namenMessage: $message;
if(!$mail->Send())
{
echo “Message could not be sent. <p>”;
echo “Mailer Error: ” . $mail->ErrorInfo;
exit;
}
header( “Location:
?>