bflosabre91 Posted June 25, 2007 Share Posted June 25, 2007 i want to alter this code for email to include attachments of txt or doc files. can someone possibly point me in the direction on how to do this? <?php include('includes/header.php'); ?> <div id="body"> <form method="post" action="sendmail.php"> <table id="emailform" align="center"> <tr> <td>First Name: </td> <td><input name="firstName" type="text"/></td> </tr> <tr> <td>Last Name: </td> <td><input name="lastName" type="text"/></td> </tr> <tr> <td>Email: </td> <td><input name="email" type="text"<br /></td> </tr> <tr> <td valign="top">Message:</td> <td><textarea name="message" rows="15" cols="50"></textarea><br /> <input type="submit" value="Submit" /></td> </tr> </table> </form> </div><!--ending div id= body--> <?php include('includes/footer.php'); ?> <?php /*Here we are going to declare the variables*/ $firstName = $_POST['firstName']; $lastName = $_POST['lastName']; $email = $_POST['email']; $message = $_POST['message']; //Save visitor name and entered message into one variable: $formcontent="VISITOR NAME: $firstName $lastName\n\nMessage: $message"; $recipient = "bflosarbe91@yahoo.com"; $subject = "Contact Form"; $mailheader = "From: $email\r\n"; mail($recipient, $subject, $formcontent, $mailheader) or die("Failure!"); echo "Thank You!"; ?> <?php header( 'Location: mailconfirm.php' ) ; ?> thanks to anyone with any information Quote Link to comment Share on other sites More sharing options...
bflosabre91 Posted June 25, 2007 Author Share Posted June 25, 2007 well i guess more specifically my question is, do i need to use a database of any type to allow for a file attachment or can i still just use SMTP?thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.