PHP - Why Mails Are Going Into Spam...???
I 'm having some problem while sending mails . i am sending bulk mails using php script, der is no problem in the script. i hope some guys have faced similar issue.
while i am sending bulk emails, i figured out that - few mails are going to spam not into their INBOX. can you guys pls give some hint to resolve this issue. .. Similar TutorialsA form is filled and the information is emailed to my address. The problem is it goes to the spam folder. Is it a problem with the email filter? I suppose I could whitelist the email address the server uses to email the info, but then spam would get through as well. Any ideas? Hi, I Have a form after successful submission a mail must be send to particular recipient and thank you mail is send to the person who filled the form ,The problem is i am receiving mails in spam whats the reason for going in spam I have kept Capture code also Can please let me know what to do I'm using this code to create and populate a database. It gets a bit involved as it is creating a series of times for every day in the year. The database gets created and populated just fine, however I have 2 quirks I can't figure out. First, I am creating a separate file to store connection creds to the database. The file gets created and holds the correct information, but as I am using the program, somehow the file is getting overwritten with blank spaces, making it impossible to connect to the database. 2nd, the program sends me an e-mail when the database is created. Problem is I'm getting 2 e-mails about 20 minutes apart. 1 with all the correct information and 1 blank. I'm thinking maybe these problems are related??? Like the program is trying to run itself twice or is getting called twice. Once the program runs, it never gets called again in any other part of the program code. Any ideas? Thanks. Code: [Select] <?php $coursename = $_POST["coursename"]; $websiteurl = $_POST["websiteurl"]; $email = $_POST["email"]; $otime = $_POST["opentime"]; $ctime = $_POST["closetime"]; $interval = $_POST["interval"]; $year = $_POST["year"]; $server = $_POST["server"]; $username = $_POST["username"]; $password = $_POST["password"]; $userpassword = $_POST["userpassword"]; //--Creates a file to store Login Information--\\ $data = <<<DATA <?php \$server = "$server"; \$username = "$username"; \$password = "$password"; ?> DATA; file_put_contents("databasedata.php", $data); //--Connect to the Server--\\ mysql_connect("$server", "$username", "$password"); //--Create the Database--\\ mysql_query("CREATE DATABASE IF NOT EXISTS TeeTimes"); mysql_select_db("TeeTimes"); //--Create the Tables--\\ mysql_query("CREATE TABLE IF NOT EXISTS CourseInfo ( Course_ID int NOT NULL AUTO_INCREMENT, PRIMARY KEY(Course_ID), CourseName varchar(40) NOT NULL default '', HomePage varchar(50)NOT NULL default '', Email varchar(50) NOT NULL default '', Password varchar(20) NOT NULL default '' )"); mysql_query("CREATE TABLE IF NOT EXISTS Daysheets$year ( Sheet_ID int NOT NULL AUTO_INCREMENT, PRIMARY KEY(Sheet_ID), Date date NOT NULL, Time time NOT NULL, Player1 varchar(30) NOT NULL default '', Cart1 varchar(3) NOT NULL default '', Player2 varchar(30) NOT NULL default '', Cart2 varchar(3) NOT NULL default '', Player3 varchar(30) NOT NULL default '', Cart3 varchar(3) NOT NULL default '', Player4 varchar(30) NOT NULL default '', Cart4 varchar(3) NOT NULL default '', Player5 varchar(30) NOT NULL default '', Cart5 varchar(3) NOT NULL default '', Men smallint(4) NOT NULL default 0, Women smallint(4) NOT NULL default 0, Guest smallint(4) NOT NULL default 0, Event varchar(3) NOT NULL default '', EventName varchar(30) NOT NULL default '' )"); //***To Populate the Database with Dates and Times***\\ mysql_query(" INSERT INTO CourseInfo (CourseName,HomePage,Email,Password) VALUES('$coursename','$websiteurl','$email','$userpassword')"); $rows = mysql_query("SELECT * FROM Daysheets$year"); if ($rows[Date]=="") { $firstday = "$year:01:01 $otime:00:00"; $firstdate = strtotime($firstday); $firsttime = "$year:01:01 $otime:00:00"; $opentime = strtotime($firsttime); $lasttime = "$year:01:01 $ctime:00:00"; $closetime = strtotime($lasttime); $time = date("g:i",$opentime); $i=1; //***To Account For Leap Years***\\ if ($year == 2012 || $year == 2016 || $year == 2020 || $year == 2024) {$n=366;} else {$n=365;} while ($i <= $n) { $newday = date("Y-m-d",$opentime); mysql_query(" INSERT INTO Daysheets$year (Date,Time) VALUES('$newday','$time')"); while ($opentime < $closetime) { $newtime = strtotime("+$interval minute", $opentime); $nexttime = date("Y-m-d g:i a",$newtime); $nextd = date("Y-m-d",$newtime); $nextt = date("g:i",$newtime); mysql_query(" INSERT INTO Daysheets$year (Date,Time) VALUES('$nextd','$nextt')"); $opentime = strtotime($nexttime); } $opentime = strtotime($firsttime); $newday = strtotime("+$i day", $opentime); $nextday = date("Y-m-d g:i a",$newday); $opentime = strtotime($nextday); $closetime = strtotime($lasttime); $newday = strtotime("+$i day", $closetime); $nextday = date("Y-m-d g:i a",$newday); $closetime = strtotime($nextday); $i++; } } mysql_close(); //--Send Information for Safekeeping--\\ $to = "someone@somewhere.org"; $subject = "Tee Time Maker User Info"; $message = "Course Name:' '$coursename \n Website: ' '$websiteurl \n E-Mail: ' '$email \n Password: ' '$userpassword"; mail($to, $subject, $message, "From: $coursename <$email>"); //--Redirect user to the newly created site--\\ header("Location: /teetimes/adminteetimes.php"); ?> Hi, I'm developing a php newsletter software but I'm in trouble with bounce mails! I set a return path directing them into a specific email box then I read that email box with php and I process bounce mails to get the kind of problem. Well, I need to get some informations about those bounce emails: The name of the user that should recive that mail, the date when the mail has been sent, the kind of error encountered; It could be so easy if I could read the body of the mail I sent into the back bounce one but every server sends a different kind of bounce...for example mailer-daemon won't let me get the body of the sent message...how can I handle this? Andrea. I've been using something like this to send email messages to users on a site: $to = $email; $subject = "Message From Microsoft.com\r\n"; $headers = "From: support@Microsoft.com\r\n"; $headers .= "Return-Path: support@Microsoft.com\r\n"; $headers .= "Reply-To: support@Microsoft.com\r\n"; $message = "<html><body><img src='http://www.Microsoft.com/images/logo.png' /><br /><br />You have a message from Bill:<br /><br />"; $message .= '<img src="' . $image . '" /><br /><br />'; $message .= 'Isn't it pretty?.<br /><br />'; $message .= '<a href="http://www.Microsoft.com">Microsoft.com</a></body></html>'; mail($to,$subject,$message,$headers); This sends, literally, text like this: <html><body><img src='http://www.Microsoft.com/images/logo.png' /><br /><br />You have a message from Bill:<br /><br /><img src="http://www.Microsoft.com/images/billiam.jpg" /><br /><br />Isn't it pretty?.<br /><br /><a href="http://www.Microsoft.com">Microsoft.com</a></body></html> Obviously, I would like the email to hide the HTML, but use it to format the output. Also, I'd obviously like the image to show up, not a link to the image, and I would like the link to show up as a link, not as HTML. How do I do this? Cheers. I have an index.php code. The code doesn't recognize UTF-8. The php identify the right part (one txt has many infos) from a .txt file and send that information to browser. Can I send this information to a specific email address instead of browser? And if Yes, can I say to this code to calculate more than one day but for more? Is this possible? Please help me with that. Thanks! [attachment deleted by admin] Hello I am working on php website. Now here im working on sending orders. So once it is ordered the confirmation e-mail goes to one who ordered(he enters his e-mail id manually) and the head of the department(e-mail ids written in code). But now I have put a checkbox that if the person is head of the department he checks the checkbox and e-mail should be sent to him. So how to verify this by checkbox.Can anyone please help me with this. The person should not get 2 e-mails. I hope I was clear in explaining my doubt. If not please do ask me for more explanation. Thank you. how to tell gmail to send plan messages only i want to send my friend a pgp-crypted mail - but this fails since the html-based mails allways do some changes to the pgp my friend receives the mails in a broken style they are not readable any more plz advice me - any and all help is much appreciated by the way i use kgpg and the editor to create the crypted message. i do not like the enigmail-addon for tbird. + But if i should try this - : Which credentials are needed to configure the einigmail - the public key that i have generated recently. love to hear from you greetings hi, im new here i hope to learn and help in the way i can since i'm a newbie with php but here it goes. I have some old databases i need to test, i want to mail these old users from a website i had but i need to know if the database contains invalid e-mails and remove them so i dont mess up my server's good ip reputation. So i found the checkdnsrr function: Code: [Select] function checkEmail($email) { // checks proper syntax if(preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/" , $email)) { // gets domain name list($username,$domain)=split('@',$email); // checks for if MX records in the DNS if(!checkdnsrr($domain, 'MX')) { return false; } return true; } return false; } so everyone knows this function, i just wanted to run it to multiple e-mail addresses like from a text file. when i say multiple, i mean arround 500.000 or 50k at the time. i just want to output the bad e-mails to a text file. hope someone can help me on this one. thanks in advance I have this script that sends an E-mail to my custoemr when an account is created and does a Bcc to me. Every email gets sent once, then about 2 min later another one is sent. So both the customer and myself get 2 emails. I did a test and just after the mail() function i write to a text file. What is odd is that it logs the sent mail 2 times. So somehow it is going through it a second time. The time difference between the first and the second seem to usually be about 2-3 min. For exampel this was only sent one time. My guess is there has to be something wrong with my headers, but i have been over them many times and tried different configurations. To: ben@....com Time 05/12/2011 12:18:30 am To: ben@...com Time 05/12/2011 12:21:09 am Code: [Select] <?php $db_con = mysql_pconnect($hostname, $username, $password) or trigger_error(mysql_error(),E_USER_ERROR); mysql_select_db($database, $db_con); if((isset($_POST['password'])) && ($_POST['password'] == 'mandb108' )) { $install_date = date("Y-m-d"); $end = mktime(0, 0, 0, date("m"), date("d"), date("y")+1); $end_date = date("Y-m-d", $end); $folder = $_POST['folder']; $school_db = $_POST['school_db']; $school_name = $_POST['school_name']; // Check to see if school, db or folder exists if (mysql_num_rows(mysql_query("Select * FROM $select_table WHERE `school_name` = '$school_name'"))) { $message = 'School Name Already Exists in Database'; } elseif (mysql_num_rows(mysql_query("Select * FROM $select_table WHERE `school_db` = '$school_db'"))) { $message = 'Database Already Exists'; } elseif (mysql_num_rows(mysql_query("Select * FROM $select_table WHERE `school_folder` = '$folder'"))) { $message = 'School Folder Already Exists'; } else { ////////////////////id, school, db, folder, install, renew, end, contact, email, job, notes $insertSQL = sprintf("INSERT INTO $select_table VALUES (null, %s, %s, %s, %s, '$install_date', null, '$end_date', %s, %s, null, null)", GetSQLValueString($_POST['school_state'], "text"), GetSQLValueString($_POST['school_name'], "text"), GetSQLValueString($_POST['school_db'], "text"), GetSQLValueString($_POST['folder'], "text"), GetSQLValueString($_POST['contact'], "text"), GetSQLValueString($_POST['email'], "text")); mysql_select_db($database, $db_con); if($Result1 = mysql_query($insertSQL, $db_con) or die(mysql_error())) { $message = 'Added to Database - Successful<br>'; } else { $message = 'Added to Database - Failed<br>'; } // Funcatiobn to copy sampel folder to new directory for school full_copy("01_sample","$folder"); // Echo results $message .= 'Install Date - '.$install_date; $message .= '<br>'; $message .= 'Expire Date - '.$end_date.'<br>'; $message .= 'Copy of Folder - Successful<br>'; $message .= '<br><br>School - '; $message .= $_POST['school_name']; $message .= '<br>Database - '; $message .= $_POST['school_db']; $message .= '<br>Folder - '; $message .= $_POST['folder']; $message .= '<br>Contact - '; $message .= $_POST['contact']; $message .= '<br>Email - '; $message .= $_POST['email']; // Write to school_info file $open = fopen ("$folder/school_info.php", "at"); fwrite($open, "<?php\n$".$old); fwrite($open, "school_folder = '$folder';\n$".$old); fwrite($open, "school_db = '$school_db';\n$".$old); fwrite($open, "database = $".$old); fwrite($open, "school_db;\n?>".$old); fclose($open); // Link to create a database on voting site $message .= '<br><a href="http://www.anaheimartscouncil.com:2082/frontend/x3/sql/index.html" target="_blank">Cpanel</a><br>'; // link to setup Database tables on new site $message .= '<br><a href="'.$folder.'/index.php?install=yes&school='.$school_name.'" target="_blank">Database Setup</a><br>'; // link to send email to client $message .= '<br><a href="web_install.php?email=yes&school_db='.$school_db.'">Send E-mail</a><br><br>'; }// end if school name, databae or folder already exists } elseif ((isset($_GET['email'])) && ($_GET['email'] == 'yes')) { $school_db = $_GET['school_db']; $results = mysql_query("select * from tbl_schools_vote WHERE school_db = '$school_db' LIMIT 1"); // removed the while loop to get rid of duplicate emails. //while($row = mysql_fetch_array($results)){ $row = mysql_fetch_array($results); $school_contact = $row['school_contact']; $school_folder = $row['school_folder']; $school_contact_email = $row['school_contact_email']; //} // end while loop $email_message = 'Dear '; $email_message .= $school_contact; $email_message .= ',<br>'; $subject = "Voting 4 Schools - Account Activated"; $email_message .= 'Your Voting 4 Schools account has been setup. Below is all the information that you should need to get started.<br><br> Here is a link to your voting site. <a href="http://www.voting4schools.com/'.$school_folder.'">www.voting4schools.com/'.$school_folder.'</a><br><br>At the bottom of the page you will find an admin link. The user name and password are as follows<br><br>User Name: admin<br>Password: vote<br><br>When you log in please go to the control panel and create a new admin user and delete the default one that we have assigned you. At the top of the page you will find a link that says video tutorial. If you are unsure how to use the software, this is a great place to start. If you have any questions, or need help setting it up, please let us know.<br><br>Thank You,<br>Ben Star<br><br>Software 4 Schools<br>(866)757-7226<br><a href="http://www.software4schools.com">www.software4schools.com</a>'; // website link here //$to = $school_contact_email.', support@software4schools.com'; $to = $school_contact_email; //$email = 'support@software4schools.com'; //$headers = "To: ".$school_contact_email."\r\n"; //$headers .= "From: Software 4 Schools <support@software4schools.com>" . "\r\n"; //$headers .= "Bcc: Software 4 Schools <support@software4schools.com>" . "\r\n"; //$headers .= "MIME-Version: 1.0" . "\r\n"; //$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n"; $headers = 'From: michael@anaheimartscouncil.com' . "\r\n" . 'Reply-To: anaheimartscouncil.com' . "\r\n" . 'Bcc: ben@software4schools.com' . "\r\n" . 'Content-type: text/html; charset=iso-8859-1'; //. "\r\n"; //. 'X-Mailer: PHP/' . phpversion(); if (mail($to, $subject, $email_message, $headers)) { $date = date('m/d/Y h:i:s a', time()); $myFile = "mail.txt"; $fh = fopen($myFile, 'a') or die("can't open file"); $stringData = "To: ". $to."\n"; fwrite($fh, $stringData); $stringData = "Time ". $date."\n\n"; fwrite($fh, $stringData); fclose($fh); $message = 'E-mail was sent once'; }else { $message = 'Problem sending message'; } } elseif ((isset($_POST['password'])) && ($_POST['password'] != 'mandb108' )) { $message = 'Password is incorrect'; $folder = $_POST['folder']; $school_db = $_POST['school_db']; $school = $_POST['school']; $contact = $_POST['contact']; $email = $_POST['email']; } else { // not sure what to do here yet... } // end if password isset from post if (!isset($_POST['school_db'])) { $school_db = 'voting_'; } ?> I'm building a PHP application that's connect to gmail and download the messages. I have an account that contains more than two millions messages and the PHP cannot connect to that account. What can I do? The error is: Mailbox has more messages (2004032) exist than maximum (1000000) Hello, guys. I'm using the following code to send me an automated mail in case the user find a broken link. But there are 2 problems: 1) after submitting I'd rather not disrupt their game by refreshing the page. So, is there any way to send mail without the post refreshing? 2) if the user hits F5, the page reloads and the code runs again, sending two or more times the same email. How can I avoid duplicated emails caused by manual browser refresh? (the most important solution currently is how to to avoid duplicated entries, in case an ajax solution is too hard to post here.) <form name="fbrlink" action="<?= $_SERVER['PHP_SELF']."?page=ok" ?>" method="post"> <?php echo('<input name="sbrlink" id="B1" type="button" value="broken Link?" style="border:none; background-color:#FFFFFF; font-family:Trebuchet MS; font-size:15px; font-weight:bold; color:#1A4877; cursor:pointer; display:block; text-decoration:underline;" onclick="this.form.submit();"/>'); ?> <?php if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ($_SERVER['QUERY_STRING'] == 'page=ok') { echo '<script type="text/javascript" >confirm("Click OK to notify us.");</script>'; mail("contact@ctt.net","report broken link","Game notified:MarioBros"); echo '<script type="text/javascript" >document.fbrlink.sbrlink.disabled = true;</script>'; ?> <script type="text/javascript" >document.fbrlink.action='<?php echo $a; ?>'; alert('<?php $_SERVER['QUERY_STRING'];?>'); </script> <?php } else {} }else{ } ?> Hello everyone, it's my first post here. I was recommend this community for it's professionalism and "friendlyness". During my stay here, please excuse my english. I know it can be unpleasant for you to read a thread with terrible grammar, I hate it in my native language, I'll do my best. Okay, so I'm having two major issues for my website to operate like I'd like it to, I've done everything I knew about, and I can't think about anything else Google didn't help me much either this time. First one is that I seem to have a cookies/sessions problem. Well, I use Liberty Reserve to allow my members to top up their account. So I send my form to their SCI and when I either cancel or complete a transaction, I return to my website but I'm not logged in anymore! So the auto-add to balance system can't work. Alright, when I saw this I was only using sessions, so I added cookies so I could rely on them too. And there again, same thing. Doubled, tripled checked all the LR settings and everything, I know they are right. But what's really, really, weird to me and what's really doing my head in is that I'm not actually logged out, because if I use another tab/window I'm still logged in. In other words, it's only the window coming back from Liberty Reserve that won't log in. The cookies are still here and so is the session so... Another terrible thing is that it used to work when I was on my previous host (just moved to a dedicated server, which may be causing the problems, it's the first time I administrate a dedi). This is blocking my entire website from working. And my second problem is with the function mail() -there again 'caused' by new server-. I don't get any error message, or anything. The e-mails with cPanel/WHM work great. Though, I have done several tests and it never reaches my Gmail, Hotmail or Yahoo account. It did work with a Yopmail inbox though. So, I was focusing on 'why isn't it sending it' but since I just noticed it worked with Yopmail, I'm sure it is sending it and have no ideas why wouldn't it work with other e-mail service providers. I hope you understood what I meant and that, hopefully, you guys can help me out with those totally handicapping issues. Thank you, Regards. -Ben. Hello, New to this forum so appreciate the patience and apologize for any breaking of etiquette. I currently have a PHP script which generates the appropriate HTML headers and body packet and would like to place it in either a Thunderbird outbox so that Thunderbird will handle sending it or put it in the Evolution outbox so Evolution will handle the actual sending of the e-mail. I've scoured the internet looking for an answer and I know it is possible because I wrote a bash script to do it a few years back that I can't find. Would appreciate any insight. Thanks, I have piping set up, where when I send an e-mail to a certain address, a script executes. This script will parse the e-mail and will post the body of the e-mails (along with a picture, if attached) to a blog. This all works okay, except the problem I keep running into is when I send from different devices (desktop, Android phone, BlackBerry), the e-mails have different character sets or encoding. So one e-mail will show up just fine, and then the body of another will look something like this: Quote --90e6ba6e83a0846c8504926b9478 Content-Type: text/html; charset=ISO-8859-1 This is the content of the e-mail. --90e6ba6e83a0846c8504926b9478-- So what I'm wondering is if there is any way to detect the charset/encoding and automatically decode it properly? The only solution I have so far -- and I'm not very good with PHP, I'll admit -- is to just "hack" my way through, by using stristr() to see if the body contains certain characters (like "ISO-8859-1"), and then extracting the text that is in between, say, "ISO-8859-1" and "--". Of course, this is very crude, and has many problems on its own. So what I am looking for is if there is some sort of way to automatically get the body of an e-mail in plain text, regardless of whether the e-mail has an attachment, how it's encoded, or what mail client was used. Thanks for your time! ive been geting attacked by a spam bot it is inserting gibrish in one of my contact forms. i managed to block it with Code: [Select] if (empty($_POST['Email']) && !empty($_POST['CustomerEmail'])) Email is an empty text field with display:none for sometime it was clean and now it succeeds once in a while to insert a form. i dont want to use captcha , i think i will loose clients your advise Hi.. I want to implement a program for identifying spam emails using an algorithm naive bayes in php.. How to implement this ..can any one help me.. thanks in advance Hey My site is getting alot of spam and i need a way to keep up with what is being sent with some kinda system that will flag things which contain urls and chosen keywords. Problem i faced though was lets say a keyword was: skyspider Now some one could say sky or spider (as seperate words) but they still flagged. So "theres a spider in the sky" would be flagged when i only want "skyspider" flagged... does that make sense? What php function do i require to do such string checks like this? Thanks Hi This subject doesn't really have a category but is driving me mad. I use the mail() function to send out emails to a news group forum that I have created. This forum does the same. I am getting the emails placed in a spam folder. Is there any way around this. I have been told that it has something to do with no reverse DNS. I get emails like DoNotReply@bt.com. This email address doesn't exist. How does the email system know this, and is there a way around it. TIA Desmond. Ok, so I want to make a comment spam filter for my site. I know the basic logic, but have yet to figure out how to write the functions. I have a database table called comments that has a column called "time", which contains a unix timestamp value of when it was posted. Basically what I want to do is this: When a user tries to post a comment, the script determines with a database query if they have posted a comment in the last 120 seconds. So basically I have to find the current time, and the time it was 120 seconds before the current time. Then I have to find any comments posted by the user that were made after the 120 second mark. My database query should then look something like this, right? Code: [Select] $query = mysql_query("SELECT * FROM comments WHERE author = ".$_SESSION['id']." AND time > '".$120secondsago"'"); Please correct me if my logic is wrong, which it very well may be, but how would I find the unix timestamp code from 120 seconds before the current time? Note that 120 seconds is just an example and also that I have not worked with dates in mysql very often. $query = mysql_query("SELECT * FROM comments WHERE author = ".$_SESSION['id']." AND time |