Has anyone creating a script for emailing website owners?
I have recently converted over to IndexU and imported my old database and want to email all the website owners, the ID and password for their website.
Has anyone creating a script for emailing website owners?
I have recently converted over to IndexU and imported my old database and want to email all the website owners, the ID and password for their website.
It's included. Go to admin panel > tool > mailing list. Create a message, then send. There you'll get 4 options: mailing list, webmaster, editor, or all.
Just select webmaster.
Btw, it's just simple mailing script. It has no advance detection for delivery and bounching message.
great, but what if I want to email only a certain category webmasters (not all)?
I know I am always asking selly Qs, but in my case I need that.
Thanx in advance
No. I will email to all webmaster.great, but what if I want to email only a certain category webmasters (not all)?
I query the database to get specific emails, (eg. i query to find all listings on my site without a website and send them an email to say im a designer and get in contact for a website quote)
It jsut returns a list of emails, and i used that and send it in my email client... maybe that would work for you?
Main IndexU sites : | Campsite Directory | Tourist Guide | Places2B | AfterDirectory <-- Half price submission using coupon DP50 (from just $11 premium, and $10 basic permanent )
Yes that would, I have a comunity directory, so sometimes I want to send email to certain businesses about updated in their fields.Originally Posted by inspireme
I use Email Delux for my newsletter, so extracting the emails will be a good thing, if I only know the syntax
Can you please help me, get emails for category_id=x
TIA
Hani
How much do you know about sql? you should be able ot work this little script out, I will comment it so you can understand better... im not sure how you want it to output the email addresses. I set this up so it automatically emails using php mail command, but im always a bit nervous about that - this iwll jsut output email addresses, and link_id and password wouldnt be much trouble either... you would have to edit it... but its somethign to get you started.
jsut save this as email.php or somethign... remember not to let peopel find it!!!
you just need ot chaneg the red bits.Code:<?php function hookUpDb(){ //these are the same as in your application.php file Global $connection; $host = 'localhost'; $user = ' username'; $password = 'password'; $db = 'db name'; if(mysql_connect($host,$user,$password)){ $connection = mysql_connect($host,$user,$password); mysql_select_db($db,$connection); return $connection; }else{ print("<b>Sorry, cannot connect to the database.</b>"); } } // Ignore these bits function doQuery($sql){ Global $connection; hookUpDb(); if(!mysql_query($sql,$connection)){ return mysql_error(); } return true; } function doQueryResult($sql){ Global $connection; hookUpDb(); if($sql != ""){ $result = mysql_query($sql,$connection); $item = array(); while($item = mysql_fetch_array($result)){ $items[] = $item; } return $items; mysql_free_result($result); } else { print("Need correctly formed SQL that returns a resultset."); } } // this is where you choose what to collect from the database // to make it easier for you change the variable to the cat_id you want to email $cat_id = 18; // if you want search ALL categories then use this instead : // $sql_1 = "SELECT * FROM idx_link "; $sql_1 = "SELECT * FROM idx_link WHERE category_id=$cat_id or cat1=$cat_id or cat2=$cat_id"; $result = doQueryResult($sql_1); if(is_array($result)){ foreach($result as $found){ // this is where it will output hte information to your screen for copy pasting. echo ($found['email']); echo (';'); echo ("<br>"); // that just outputs all the emails in the category you suggested. // if you wanted to send them a link ID and password, you could save the following as a .csv file and // import it into a spreadsheet, each field is seperated by a | so you can setup some mail merge or however you want to do it... /* echo ("$found['email']"); echo (' | '); echo ("$found['password']"); echo (' | '); echo ("$found['link_id']"); echo (' | '); echo ('/n/n'); */ } } // very rough, but you should get some ideas to adapt as you like. ?>
Last edited by inspireme; 08-14-2006 at 02:51 PM.
Main IndexU sites : | Campsite Directory | Tourist Guide | Places2B | AfterDirectory <-- Half price submission using coupon DP50 (from just $11 premium, and $10 basic permanent )
Thanx
This is Greek to me, I would tell when a semicolon is missing, but thats almost as much as I know
When I try it as is I get a (simple) parse error in line 94
if I comment line 88 and uncomment line 92 i get this:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /var/www/vhosts/yahala.com/httpdocs/ydir/mmail.php on line 106
honestly i never tested it - will have a look and post where i went wrong![]()
Main IndexU sites : | Campsite Directory | Tourist Guide | Places2B | AfterDirectory <-- Half price submission using coupon DP50 (from just $11 premium, and $10 basic permanent )
Thanx, I really appreciate that, take your time![]()
try it now
Main IndexU sites : | Campsite Directory | Tourist Guide | Places2B | AfterDirectory <-- Half price submission using coupon DP50 (from just $11 premium, and $10 basic permanent )
?
Same error, why wouldnt it be? unless ofcourse you are a magician or a hackerI dought the second as you dont even know my website name.
Oh oh, you do, all the world does
anyway its the same error unless you need me to use the original code
same error with original code
I edited my post, have you copied pasted it as i have it now?
anyway, you can fix it yourself, i missed the semi colon off from line 88 and it should be two brackets } at the end. the errors you mentioned are the same as i had, and i corrected them in the code i posted.
I also made a change so it now searches for links that may have the cateory id your searching for set as a second or 3rd cateogry instead of just the first.
Anyway, i tried what i have posted again and it works, the only thing that would stop it working is that you dont have the right database settings or that the category id number on line 88 is set to a number that doesnt have links in... try copy the code and paste it in again![]()
Last edited by inspireme; 08-14-2006 at 02:52 PM.
Main IndexU sites : | Campsite Directory | Tourist Guide | Places2B | AfterDirectory <-- Half price submission using coupon DP50 (from just $11 premium, and $10 basic permanent )