thesnarkie Posted September 29, 2009 Report Share Posted September 29, 2009 <html> <title>Mass Email</title> </head><body> <form action="?action=send" method="post"> Subject: <br/> <input type="text" name="subject"/> <br/> <br/> Country: <br/> <select name="country"> <option value="EE">EE</option> <option value="LT">LT</option> <option value="LV">LV</option> </select> <br/> <br/> Email message: <br/> <textarea name="body" cols="40" rows="15"> </textarea> <br/> <br/> <input type="submit" value="Send!"/> </form> </body> </html> <? $db_username = ""; $database = ""; $db_password = ""; $hostname = ""; $db = mysql_connect($hostname,$db_username,$db_password); mysql_select_db($database,$db); if($_GET['action']=="send") { $country = $_POST['country']; $subject = $_POST['subject']; $message = $_POST['message']; $message_to_send = wordwrap($message,70); $from = "noreply@tralala.lv"; $headers = "From: $form"; $sql = mysql_query("SELECT `email` FROM `accounts` WHERE `country`='$country' AND `login_name`='snarkie'",$db); while($row = mysql_fetch_assoc($sql)){ $email = $row['email']; mail($email,$subject,$message,$headers); if(mysql_affected_rows()==1) { echo "Sent to: " . $email . "<br/>"; } } } ?> Vai kaut kas ir nepareizi, ka es nesaņemu e-pastu? : D Viņš parāda to sent to, bet neko nesaņemu. Quote Link to comment Share on other sites More sharing options...
briedis Posted September 29, 2009 Report Share Posted September 29, 2009 Iespējams, headeru trūkums, serveris "sliktajā sarakstā"... Izmanto labāk kādu meilu sūtīšanas klasīti, kā piemēram - phpMailer ( http://phpmailer.worxware.com/ ) Quote Link to comment Share on other sites More sharing options...
thesnarkie Posted September 29, 2009 Author Report Share Posted September 29, 2009 Ok, pamēģināšu ar šito.. 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.