Jump to content

[SOLVED] Checkbox mail List / Round 2 (e-mail help)


Recommended Posts

Hey guys, Ok I've got help / solved the first bit of php from before. ---> http://www.phpfreaks.com/forums/index.php/topic,164936.0.html

 

Now I need the actual mailing part of this to work. Can someone take a look over my code and guide me?

 

Site: www.bbold.com/mail.php

 

			<?php
			// Connect to DataBase
			include 'includes/dbconnect.php';


				// Query database
				$query = "SELECT * FROM mail";
				$rs = mysql_query($query);
					echo 'Subscription List <br /><br />';
					echo "<form name=\"myform\" action=\"" . $_SERVER['PHP_SELF'] . "\" method=\"post\">" . "<br />";
						while($row = mysql_fetch_array($rs))
							{
								echo "<input type=\"checkbox\" name=\"list[]\" value=\"" .$row['email']. "\" >" . " <a href=\"mailto:" . $row['email'] . "\">" . $row['email'] . "</a><br />";
							}	

// If summit button clicked do this!!
if($_POST['submit'])
	{




//send the email
$content = "put content here";

//start mail script
$to = foreach($_POST['list'] AS $email){ $email . ";  ";}
$subject = "Thank you for registering at Morowat Global";
$message = $content;

$headers = "From: jordan@morowatglobal.com\r\n";
$headers .= "Reply-To: jordan@morowatglobal.com\r\n";
$headers .= "Return-Path: jordan@morowatglobal.com\r\n";
$headers .= "'From: ".$from."'\n";
$headers .= 'MIME-Version: 1.0' . "\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\n";


if ( mail($to,$subject,$message,$headers) )



	}

		?>

<br />
<input type=button value="Check All" onClick="this.value=check(this.form.list[])">
<br/>
Send an e-mail:<br />
<textarea name="message" rows="10" cols="70"></textarea><br/><br />
<input type="submit" name="submit" value="Send">

 

Thanks

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.

×
×
  • 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.