A simple HTML form can be used to pass details to the script to be sent instead of the fixed message used previously.
Important parts to the form are the filename of the script
And the variable that will contain the data from the form
<form name="contact" method="post" action="phpmailerscript.php">
<input name="name" type="text" size="45" value="<?php echo $name ?>">
Then in the phpmailer script the variable needs to be collected and put in the body of the sent email. For example replace the previous
$mail->Body = "hi ! \
this is First mailing I made myself with PHPMailer !";
$mail->Body = "Name: $name\
now how do we add an attachment??