Reputation: 2578
I've had this huge problem with the mails sent from my domain, that are being caught by Gmail's spam-filter. The mails that I'm sending, are invoices to customers who haven't received anything from the sending e-mail address, so I guess that's one reason why the mail is going to spam. I also think that another reason is, that the system sent out about 150 emails before I realized, that they all ended in spam, and according to a MailChimp article, the last row of the first table, then spam-filters notice if the sending-mail have been marked as spam, on other accounts ( the article: http://kb.mailchimp.com/article/avoiding-the-spam-filters ). The system is made in PHP, so I'm trying to make a way, that I can send out e-mails from the system I've made to recipients who haven't received anything from me before - that's all I need to do. It sounds so simple...
Now, I've tried quite a few things. Here are a quick list, so you know what can and can't be done - and what I've tried:
Delivered-To: [email protected] Received: by 10.76.75.104 with SMTP id b8csp48728oaw; Sat, 16 Mar 2013 17:32:56 -0700 (PDT) X-Received: by 10.152.116.45 with SMTP id jt13mr7897860lab.0.1363480376067; Sat, 16 Mar 2013 17:32:56 -0700 (PDT) Return-Path: Received: from mail-out2.b-one.net (mail-out2.one.com. [91.198.169.19]) by mx.google.com with ESMTP id p10si4637427lbb.120.2013.03.16.17.32.55; Sat, 16 Mar 2013 17:32:55 -0700 (PDT) Received-SPF: neutral (google.com: 91.198.169.19 is neither permitted nor denied by best guess record for domain of [email protected]) client-ip=91.198.169.19; Authentication-Results: mx.google.com; spf=neutral (google.com: 91.198.169.19 is neither permitted nor denied by best guess record for domain of [email protected]) [email protected] Date: Sat, 16 Mar 2013 17:32:55 -0700 (PDT) Message-Id: Received: from localhost.localdomain (srv18.one.com [193.202.110.18]) by mail-out2.b-one.net (Postfix) with ESMTP id F3D0B10365 for ; Sun, 17 Mar 2013 01:32:53 +0100 (CET) Received: from 85.218.159.219 by www.lyobeachcamp.dk via URL_TO_THE_SCRIPT.php with HTTP; Sun, 17 Mar 2013 00:32:53 +0000 To: RECIEVERS_NAME Subject: Faktura på depositumet X-PHP-Originating-Script: 87486:NAME-OF-THE-SCRIPT-THE-E-MAIL-WAS-SENT-FROM.php Reply-To: Lyø Beach Camp From: Besked fra Lyø Beach Camp MIME-Version: 1.0 Sender: Besked fra Lyø Beach Camp Content-type: text/plain; charset="utf-8"; X-Mailer: PHP5.3.21 Hej E-MAIL-OWNER-NAME. Her er et link til din faktura http://www.lyobeachcamp.dk/ENCRYPTED_URL_TO_INVOICE.pdf . Du skal betale denne faktura indenfor den næste 5 dage. Senere hen vil du modtage en faktura på restbeløbet. Du vil så modtage dit rejsebevis kort før afrejse-datoen (omkring to ugers tid før). Vi kan desværre ikke melde de eksate flytider ud, før da. Du kan dog følge med i de midlertidige flytider som vi har på http://www.lyobeachcamp.dk/flytider . Med venlig hilsen Lyø Beach Camp Web: http://www.lyobeachcamp.dk Mail: Hvis der er noget, så er du altid velkommen til at skrive os en mail på [email protected]
So my question is this:
Any points in the right direction, suggestions or thoughts are greatly appreciated. I'm quite desperate here!
Thank you for your time.
Upvotes: 3
Views: 9519
Reputation: 6958
You can configure php mail to use a smtp rather than through server sendmail program.
Heres an inline script for SMTP i found on google
http://www.9lessons.info/2009/10/send-mail-using-smtp-and-php.html
-OR-
A pear package
http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm
Just drop in your gmail smtp settings.
you can also do this at the server level
php.ini
[mail function]
; For Win32 only.
SMTP = mail.yourserver.com
smtp_port = 25
auth_username = smtp-username
auth_password = smtp-password
sendmail_from = [email protected]
via php.ini & SMTP= - how do you pass username & password
Upvotes: 2
Reputation: 168655
There are several good mailer libraries for PHP.
My preferred one is phpMailer.
Upvotes: 1
Reputation: 1098
Try the Sendgrid system. It is really easy to use and you can use up to 200 sent e-mails per day for free if it is sufficient.
We are using it now in our PHP app and it works nicely.
Upvotes: 4
Reputation: 3221
In short there isn't a simple answer or special header you can include. It would be pointless if that existed as I'm sure most spammers would take advantage of it. One thing I've encountered with Google Mail is they seem to be very strict on the senders address and the domain.
Check the sender domain isn't registered with any black lists and that you've got valid DNS records ideally with PTR records
Configuring PHP to use SMTP as suggested by @j_mcnally would be my perferred solution
Upvotes: 0
Reputation: 9547
If all you had to do was put in a super spiffy header to bypass SPAM filters, don't you think SPAMMERS would do that too? ;)
This isn't a delivery issue. Either A) your IP is blacklisted, or B) your content is spammy. You need an SPF record to really do much more about this issue.
I would absolutely not recommend sending with FROM or REPLY-TO headers from a domain name like gmail.com or something that's very clearly not owned by you.
Upvotes: 4