Jump to content

Add / Upload Attachment


downah
 Share

Recommended Posts

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>

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

This thread is more than a year old. Are you sure you have something important to add to it?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.