I am using a simple PHP script to send mail. But my emails are going to the spam folder. Sender of the received mail in spam folder is listed as:     mymail@gmail.com via pro10.winwinhosting.com   And the email message is showing this warning:     Why is this message in Spam? We've found that lots of messages from   pro10.winwinhosting.com are spam   My PHP script looks like this:   $email_to = $_SESSION['email']; $email_subject = "Mail Subject/#/ "; $message = "Some message"; $headers  = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From: ABC &lt;mymail@gmail.com&gt;' . "\r\n"; mail($email_to, $email_subject, $message, $headers);
949
This is a tricky one and I've always relied on techniques, such as permission-based emails (i.e. only sending to people you have permission to send to) and not using blatantly spamish terminology.  Of late, some of the emails I send out programmatically have started being shuffled into people's spam folder automatically and I'm wondering what I can do about it.  This is despite the fact that these particular emails are not ones that humans would mark as spam, specifically, they are emails that contain license keys that people have paid good money for, so I don't think they're going to consider them spam  I figure this is a big topic in which I am essentially an ignorant simpleton.
23769
There is a newsletter I receive that Gmail insists should go into the spam folder.    How can I mark it as not spam and move it to the inbox?  I know how to do it in Gmail, but not in Inbox.  How can I tell Gmail not to send that newsletter to spam in the future?
80492
I'm having some trouble with setting up a SMTP server on a windows server 2003 machine, while trying to send emails using PHP through the internet, but to domain email addresses.  Common info:   Machine has Windows Server 2003 Server Machine on a domain (mydomain.com) Machine is not a domain controller Machine accesses a domain controller through the internet (WAN with a corporate VPN link by the internet provider setup on the machine's gateway - adsl modem/router) Email addresses use the same suffix (mydomain.com) Do not have access to domain controller configuration   First Scenario   TCP/IP DNS: 1st 192.168.200.xxx   2nd 8.8.8.8 Direct access to domain controller is functional PHP mail using localhost to a user@mydomain.com won't work, because the remote mail server rejects emails from internal traffic (apparently!?!)   Second Scenario   TCP/IP DNS: 1st  8.8.8.8   2nd 192.168.200.xxx   (switched) Direct access to domain controller is not functional, only local accounts work PHP mail using localhost to a user@mydomain.com does work, because the remote mail server is accessed through its internet/external address.   So, what I needed is to have both (1) access to the domain controller and (2) PHP mail using localhost to a user@mydomain.com account working.  Any pointers? Thanks in advance
100381
Is there a way to block a local/unix user (or a list of local users) from sending mails via mail command (or maybe even in postfix, which is the MTA I have).
59503
Gmail seems to have deleted the attachment of an email I had sent to myself a while after I sent it. The reason Gmail hints at is that the file is detected as a virus (it's not): is there any way to get access to that file?    The "Learn more" link redirects me to , which says:     What happens if a virus is found?      If Gmail detects a virus on an attachment, we reject the message and   notify the sender. If a message that’s already in your account has an   infected attachment, you won’t be able to download it.      If an attachment you're trying to send is infected with a virus, Gmail   will display an error message to tell you, but it won't clean the   file. To send the message without that attachment, click the link in   the error message that says Remove attachment and send.      If Gmail detects that you're trying to send an infected attachment,   try running your anti-virus software in case your hard drive is   infected. If you don't have anti-virus software, you might consider   purchasing or installing one of the popular applications so you can   protect your computer and information from viruses.   If I try to forward the email, I cannot forward the attachment:    Is there anyway I can retrieve access to my file?
37436
I'm using  to check if a user-provided email address is valid. For example:  $email = $_POST['email']; if ( is_email( $email ) )     // Do something.   To the best of my knowledge, nothing in this function writes info to the database. Should I be sanitizing $email before I pass it to the function?
8365
Last months I have lots of referrer spammers in my GA statistics. Their count is ~10x higher than count of legit visitors (my site is not very popular yet). I've turned on an option to hide known spammers in GA settings, but it didn't help at all. It seems these spammers are using scripts to spam directly to GA (i.e. they are not logged in my IIS).  Is there anything I can do to stop these spammers?    UPD 10 months later, and they started spamming using fake target page names... and Google is still doing nothing about it.
108709
I want a utility that does something like this:  email --subject="xxx" --body=body.txt --to=to_address@hostname.com   (using pre-configured sender information for e.g. gmail). Note that body.txt is plain text and should be the body of the message, not an attachment. If the body is omitted it should pop up an editor and let me type in my message that way.  I could hack together a quick script that does this, but I was wondering if there's an easy way to do this with common unix tools?
27862
I awoke this morning to a spam flag on a site I moderate, and noticed this when I went to read the post.    Notice answered&lt;/a&gt;, which I imagine isn't meant to have the &lt;/a&gt; there.  I also confirmed that this displays asked&lt;/a&gt; for other types of flags (namely, closed without comment).   I looked around for a duplicate of this but can't seem to find it, so maybe it's a recent change?
102106
The problem is a whole load of 404 errors, as reported by Google Webmaster Tools, with pages and queries that have never been there. One of them is viewtopic.php, and I've also noticed a scary number of attempts to check if the site is a WordPress site (wp_admin) and for the cPanel login. I block TRACE already, and the server is equipped with some defense against scanning/hacking. However, this doesn't seem to stop. The referrer is, according to Google Webmaster, totally.me.  I have looked for a solution to stop this, because it isn't certainly good for the poor real actual users, let alone the SEO concerns.  I am using the Perishable Press mini black list (), a standard referrer blocker (for porn, herbal, casino sites), and even some software to protect the site (XSS blocking, SQL injection, etc). The server is using other measures as well, so one would assume that the site is safe (hopefully), but it isn't ending.  Does anybody else have the same problem, or am I the only one seeing this? Is it what I think, i.e., some sort of attack? Is there a way to fix it, or better, prevent this useless resource waste?  EDIT I've never used the question to thank for the answers, and hope this can be done. Thank you all for your insightful replies, which helped me to find my way out of this. I have followed everyone's suggestions and implemented the following:   a honeypot a script that listens to suspect urls in the 404 page and sends me an email with user agent/ip, while returning a standard 404 header a script that rewards legitimate users, in the same 404 custom page,  in case they end up clicking on one of those urls. In less than 24 hours I have been able to isolate some suspect IPs, all listed in Spamhaus. All the IPs logged so far belong to spam VPS hosting companies.   Thank you all again, I would have accepted all answers if I could.
40552
I have a postfix server installed on Ubuntu 14.04. A PHP script running on the machine uses it to send outgoing email. Additionally, I use postfix to receive mail sent to a local account, which is then forwarded to my personal gmail.  However, this means that anyone can connect to my server and use it as an open relay for spam. How can I  prevent remote connections from relaying email?  This is my main.cf:  smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination myhostname = aviacao.pt virtual_alias_maps = hash:/etc/postfix/virtual alias_database = hash:/etc/aliases myorigin = /etc/mailname mydestination = aviacao.pt, localhost.localdomain, localhost relayhost =  mynetworks = 0.0.0.0/0 mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all inet_protocols = ipv4   If I change mynetworks to 127.0.0.0/8 then people won't be able to send email to the local account.
14172
On my homepage, I'm using this method to hide my email from spam bots:  &lt;a href="admin [at] example.com"    rel="nofollow"    onclick="this.href='mailto:' + 'admin' + '@' + 'example.com'"&gt;Contact me&lt;/a&gt;   What do you think about it? Is it effective? What other methods do you know or use?
87674
I received one actual Google message and at least three spam emails today which displayed an icon of some sort in the subject title. I cannot find an option to turn off this visual noise; some of the icons are even animated!  Heading only:         Gmail interface:
120237
Prima facie this is impossible but perhaps someone has some kind of hack to do it. This is one of the last things holding me back from switching to Gmail from Pine.  To be clear, bouncing a message is like forwarding but leaving all the headers intact. It sort of amounts to spoofing the email, which perhaps is why Gmail doesn't support it. To the recipient of a bounced email, it seems as if they were just BCC'd.
33135
I'm suffering from a spam hack where my site periodically starts to show Viagra spam to Google and other spiders. The method of the hack is basically that my .htaccess file gets modified to route all requests through a file called "common.php", which is a big chunk of base64 encoded evilness.  I've noticed it happening on a weekly basis: every time I remove the hacked files, it pops back up a few days later. These are the steps I've already taken to secure things:   Changed my FTP password Scanned my (shared hosting) directories for world-writable (777) files/folders and changed them to 755 or something more appropriate Removed old copies of Wordpress from unused directories (the site itself is a custom-written PHP CodeIgniter app) Downloaded the entire site to my local box and scanned the directories for occurences of strings like "base64" and ".ru" (spam domains?).   I'm a little uncertain what to do next as the problem still seems to be there. Is there some smart shell command I can run to figure out how these files are being uploaded? When I last checked, the .htaccess file was edited today by my own FTP user despite me changing the password a week ago and logging out any logged-in users. I don't leave it logged in on public machines, and a few other administrators of the site haven't been given the new password yet.  Any tips / ideas gratefully received. I'm happy to provide the output of any specific commands as needed.  Matt
83962
I've got to send a bulk email out to a bunch of people in reply to emails they sent me. I've got all the original emails stored in a single outlook folder. I want to extract all of the reply addresses from the emails in that folder so I can send an email to all of them.  The article  shows you how to export the FROM address of these emails, however a large amount of them came from a web service that sends emails 'on behalf of' the person I'm trying to mail to. So I need the reply-to address, and the export wizard doesn't do that.  Does anyone have a tip on how to do this? This is Outlook 2007 on Exchange 2010.
22255
This is a  about Fighting Spam.   Also related:                    There are so many techniques and so much to know about fighting SPAM. What widely used techniques and technologies are available to Administrator, Domain Owners, and End Users to help keep the junk out of our inboxes?  We're looking for an answer that covers different tech from various angles. The accepted answer should include a variety of technologies (eg SPF/SenderID, DomainKeys/DKIM, Graylisting, DNS RBLs, Reputation Services, Filtering Software [SpamAssassin, etc]); best practices (eg mail on Port 25 should never be allowed to relay, Port 587 should be used; etc), terminology (eg, Open Relay, Backscatter, MSA/MTA/MUA, Spam/Ham), and possibly other techniques.