-
Posts
56 -
Joined
-
Last visited
About francis Aneke
- Birthday August 20
Previous Fields
-
Languages
ENGLISH
Contact Methods
-
AIM
TO MASTER ICT WORLD
-
Website URL
http://awaenvirons.com
-
Yahoo
francisaneke488@yahoo.com
Profile Information
-
Location
NIGERIA
-
Interests
Love to be an all time web developer. Love to master sql, php, javascript, Ajax, Asp, 3D Video Animation with MAYA and Cinema 4D. And finally i love my PHP
francis Aneke's Achievements
Newbie (1/7)
0
Reputation
-
I have this website( awaenvirons.com) on a Hosting site called Hostparker....which I hosted on Internet on 2014 but it has expired late last year......so I want to ask if the website can be re-established the way it is before, if I pay for another plan.....I think it has been more than 4 months now.... (This site was almost coded manually by me and I knew what it took me to do that)
-
how to send email message to multiple emails in a database using php
francis Aneke replied to francis Aneke's topic in PHP
No you did well chikwado, it does not violate w3schools policy,its ok because even moderators are making that kind of reference, so far it can help at all cost......Thanks -
That's because $e is a single value from a database field, not an array. that is among what am saying how can you get an array of those emails and then use "foreach($e as $mailTo)" to get them one by one and pass the contact message to them; Just a brief code please.......
-
how to send email message to multiple emails in a database using php
francis Aneke replied to francis Aneke's topic in PHP
still couldn't solve it. Remember that all the emails are being fetched out of database........ So its like you didnt note that one.. There are several ways to actually send the email. Phpmailer is a popular choice. please how? -
Please i have been on this for days without any final correct result:- 1.The code below simply select names from moderators, a table upgrading user levels based on how they use the wbsite. 2.It uses the names to select users who loves contact messages to appear on their emails, when a user sents a contact message( the names of this email lovers are entered on the doesanddont table with msgDont='0') . 3.The very names of users on doesanddont table is use to in turn select emails from users table, Which is use to finally passed the message to all of them as coded in the "foreach($e as $mailTo){}" loop below. But when this message is being sent, it comes in multiple, multiple times into each emails. PLEASE HELP ME TWIST THIS CODE for the emails to receive the message once every time an email is sent from contact page(http://awaenvirons.com/contact.php).... And "foreach($e as $mailTo)" is not working after i replaced a line of code with it... ******************************************************************* if($username !="" || $nickname !=""){ $emailer = ""; if($username !=""){ $emailer = $username; }else $emailer = $nickname; $all_moderators = array(); $query_level = "SELECT moderator FROM moderators WHERE userlevel='a' OR userlevel='b' OR userlevel='c' OR userlevel='d' OR userlevel='e'"; $sql_level = mysqli_query($db_conx, $query_level); ///$row = mysqli_fetch_assoc($sql_level); while($row = mysqli_fetch_array($sql_level, MYSQLI_ASSOC)) { $moderator = $row['moderator']; array_push($all_moderators, $moderator); $Logic = ''; foreach($all_moderators as $key => $user){ $Logic .= "username='$user' AND msgDont='0' OR "; } //chop off the last OR from the $Logic $Logic = chop($Logic, "OR "); $all_DU = array(); ///Regulate whom to receive message $DoesAndDont = "SELECT username FROM doesanddont WHERE $Logic"; $query_does = mysqli_query($db_conx, $DoesAndDont) or die('line'.__LINE__.':'.mysqli_error($db_conx)); while($row = mysqli_fetch_array($query_does, MYSQLI_ASSOC)) { $DU = $row['username']; //Does_user array_push($all_DU, $DU); $DU_Logic = ''; ///$DoesU = ''; foreach($all_DU as $key => $DU){ ///$DoesU .="$DU "; $DU_Logic .= "username='$DU' OR "; } $DU_Logic = chop($DU_Logic, "OR "); ////$errorContactMessage = "<br /><br />Carry on $DU_Logic "; $query_email = "SELECT username, email FROM users WHERE $DU_Logic"; $sql_email = mysqli_query($db_conx, $query_email); while($row = mysqli_fetch_array($sql_email, MYSQLI_ASSOC)){ $e = $row['email']; $e_user = $row['username']; ///learn array in other to pack email and username inside ///$mailTo =''; foreach($e as $mailTo){ ///insert into EMAIL ///$errorContactMsg = "<br /><br /><p style='color:green'>Contact Message Sent Successfully </p>"; $from = "auto_responder@awaenvirons.com"; $subject = '[AE] AwaEnvirons Contact Message'; $message = '<!DOCTYPE html><html><head><meta charset="UTF-8"> <title>AwaEnvirons Contact Message</title> </head><body style="margin:0px; font-family:Tahoma, Geneva, sans-serif;"> <div style=" padding:10px; background-image: -webkit-linear-gradient(top, #ffffff, #4e6d04); background-image: -moz-linear-gradient(top, #ffffff, #4e6d04); background-image: -o-linear-gradient(top, #ffffff, #4e6d04); background-image: linear-gradient(#ffffff, #4e6d04); font-size:24px; font-weight:bold; color:red; "> <a href="http://www.awaenvirons.com"><img src="http://www.awaenvirons.com/images/logo.png" width="50" height="30" alt="[AE]" style="border:none; float:left;"></a>AwaEnvirons Contact Message</div><divstyle="padding:24px; font-size:15px;">chi chi<p style="margin-top:30px; font-size:12px; text-align:right; color:green; border-top:1px green solid;">Powered By: MR FRANCIS and AwaEnvirons Team</p></div></body></html>'; $headers = "From: $fromn"; $headers .= "MIME-Version: 1.0n"; $headers .= "Content-type: text/html; charset=iso-8859-1n"; $mail = mail($mailTo, $subject, $message, $headers); if($mail){ $errorContactMsg = "<br /><br /><p style='color:green'>Contact Message Sent Successfully $mailTo</p>"; } } //} } }///for $query_does }///for $sql_level }
-
how to send email message to multiple emails in a database using php
francis Aneke replied to francis Aneke's topic in PHP
Am frankly using php if u can give me a hint may be by using for loop or for each statement to iterate through all the emails in the database and pass the message to all of them -
how to send email message to multiple emails in a database using php
francis Aneke replied to francis Aneke's topic in PHP
Can you give me a code hint? -
Its like your still using your local connection password which might not be the same as the one at the real server
-
Chikwado, just a bros chinedu; I have come across this problem before. Just go to the file you have your connection to database and correct your password and username to your hosting account password and username. Try that one
-
The code is sending multiple messages to all the emails at the same time. Even if you send one message, it will send it into multiple times to each email in my database... PLEASE how can i twist my code to send the messages without having it multiple times in each email //////////////////////////////////////////////////////////////////////////////// while($row = mysqli_fetch_array($sql_level, MYSQLI_ASSOC)) { $moderator = $row['moderator']; array_push($all_moderators, $moderator); $Logic = ''; foreach($all_moderators as $key => $user){ $Logic .= "username='$user' AND msgDont='0' OR "; } //chop off the last OR from the $Logic $Logic = chop($Logic, "OR "); $all_DU = array(); ///Regulate whom to receive message $DoesAndDont = "SELECT username FROM doesanddont WHERE $Logic"; $query_does = mysqli_query($db_conx, $DoesAndDont) or die('line'.__LINE__.':'.mysqli_error($db_conx)); while($row = mysqli_fetch_array($query_does, MYSQLI_ASSOC)) { $DU = $row['username']; //Does_user array_push($all_DU, $DU); $DU_Logic = ''; $DoesU = ''; foreach($all_DU as $key => $DU){ //$DoesU .="$DU "; $DU_Logic .= "username='$DU' OR "; } $DU_Logic = chop($DU_Logic, "OR "); $errorContactMessage = "<br /><br />Carry on $DU_Logic "; $all_e = array(); $query_email = "SELECT email FROM users WHERE $DU_Logic"; $sql_email = mysqli_query($db_conx, $query_email); while($row = mysqli_fetch_array($sql_email, MYSQLI_ASSOC)) { $e = $row['email']; array_push($all_e, $e); foreach($all_e as $key => $e){ ///insert into EMAIL $to = "$e"; //$to = "francisaneke488@yahoo.com"; $from = "auto_responder@awaenvirons.com"; $subject = '[AE] AwaEnvirons Contact Message'; $message = '<!DOCTYPE html><html><head><meta charset="UTF-8"> <title>AwaEnvirons Contact Message</title> </head><body style="margin:0px; font-family:Tahoma, Geneva, sans-serif;"> <div style=" padding:10px; background-image: -webkit-linear-gradient(top, #ffffff, #4e6d04); background-image: -moz-linear-gradient(top, #ffffff, #4e6d04); background-image: -o-linear-gradient(top, #ffffff, #4e6d04); background-image: linear-gradient(#ffffff, #4e6d04); font-size:24px; font-weight:bold; color:red; "> <a href="http://www.awaenvirons.com"><img src="http://www.awaenvirons.com/images/logo.png" width="36" height="30" alt="awaenvirons.com" style="border:none; float:left;"></a>AwaEnvirons Contact Message</div><divstyle="padding:24px; font-size:15px;">mmmmmmTmmmm<p style="margin-top:30px; font-size:12px; text-align:right; color:green; border-top:1px green solid;">Powered By: MR FRANCIS and AwaEnvirons Team</p></div></body></html>'; $headers = "From: $fromn"; $headers .= "MIME-Version: 1.0n"; $headers .= "Content-type: text/html; charset=iso-8859-1n"; $mail = mail($to, $subject, $message, $headers); if($mail){ $errorContactMsg = "<br /><br /><p style='color:green'>Contact Message Sent Successfully</p>"; } } }