downah Posted March 6, 2012 Share Posted March 6, 2012 I have got this running, which takes 2 fields subject and plain and will email it to the emails in the database, how can I make it so I have another field which he can upload for example .pdf files and send them with the email? <?php include "connect.php"; $subject = stripslashes($_POST["subject"]); $plain = stripslashes($_POST["plain"]); $result = mysql_query("SELECT email FROM member"); $emails = array(); while ($row = mysql_fetch_row($result)) $emails[] = $row[0]; $subject = $_POST['subject']; $from = "noreply@wgtfgb.com"; $headers = "From:" . $from; $to = implode(", ", $emails); mail($to, $_POST['subject'], $_POST["plain"], $headers); ?> <link rel="stylesheet" type="text/css" href="view.css" media="all"> <script type="text/javascript" src="view.js"></script> <form id='register' action='updateprofile.php' method='post' accept-charset='UTF-8'> <body id="main_body" > <img id="top" src="top.png" alt=""> <div id="form_container"> <h1>Newsletter Sent</h1> <form id="form_362567" class="appnitro" method="post" action=""> <div class="form_description"> <h2> Newsletter Sent</h2> <p></p> </div> <ul > <li class="section_break"> <p></p> </li> <li id="li_2" > <label class="description" for="email"> <?php echo "Newsletter successfully sent, you will be redirected back to the member area in 5 seconds."; ?> </form> <div id="footer"> <meta http-equiv="refresh" content="5; URL=index.php"> </div> </div> <img id="bottom" src="bottom.png" alt=""> </body> Quote Link to comment https://forums.phpfreaks.com/topic/258384-add-upload-attachment/ Share on other sites More sharing options...
Adam Posted March 6, 2012 Share Posted March 6, 2012 Have a read through some tutorials and have a bash yourself first. If you get stuck then post your code and we'll be happy to help you fix it, but we're not here to write it for you. http://www.google.co.uk/search?q=php+send+email+attachments Quote Link to comment https://forums.phpfreaks.com/topic/258384-add-upload-attachment/#findComment-1324476 Share on other sites More sharing options...
downah Posted March 6, 2012 Author Share Posted March 6, 2012 Thanks, I have searched on google there is a few things out there with pear for example but what I like about discussion forums and asking questions here is the answers are personalized to my problem, instead of someone else's, I don't mean to do harm Quote Link to comment https://forums.phpfreaks.com/topic/258384-add-upload-attachment/#findComment-1324500 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.