romio Posted March 15, 2006 Share Posted March 15, 2006 This is my mail_sender.php which i use to get some values from a form and send to all subscribers...[code]<?phprequire_once('config.inc.php');$query = "select * from subscribers order by id";mysql_select_db($database, $dbcnx);$result = mysql_query($query) or die('Error, insert query failed');$num_rows = mysql_num_rows($result);if ((isset($_POST["MM_Mailer"])) && ($_POST["MM_Mailer"] == "subscribe")) { $subject_Form = $_POST['subject']; $message_Form = $_POST['message']; $email = $_POST['email']; while($row = mysql_fetch_array($result)) { $email = $row['email']; $headers .= "Miramare Beach Hotel"; $headers .= "Content-Type: text/plain; charset=iso-8859-1\n"; $recipient = $email; $subject = $message_Form; $message = $message_form; $msg = wordwrap( $msg, 1024 ); mail($recipient, $subject, $message, stripslashes($msg), $headers); }} if(mail($recipient, $subject, $message, stripslashes($msg), $headers)) { echo "<meta HTTP-EQUIV=\"REFRESH\" content=\"0; url='MailIsSend.php'\">"; } else { echo "The message can not been sent !<br />\n"; }?>[/code]But i need to add an attachment to my mail how can i do that?Thanks. Link to comment https://forums.phpfreaks.com/topic/5040-add-an-attachment-to-mail/ Share on other sites More sharing options...
obsidian Posted March 15, 2006 Share Posted March 15, 2006 attachments are possibly the single most complex thing you can do with PHP mail() function, but after careful study of a tutorial like [a href=\"http://www.hollowearth.co.uk/tech/php/email_attachments.php\" target=\"_blank\"]this one[/a], you should have a pretty good base for getting it done. Link to comment https://forums.phpfreaks.com/topic/5040-add-an-attachment-to-mail/#findComment-17826 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.