3

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:

  • The domain is hosted with One.com, and they don't support that customers can setup their own SPF-record or DKIM-record (not that I know what they are - because I quickly realized that that wasn't an option to fiddle with that).
  • PHPmailer is not an option, since it's hosted with One.com, so I can't install it in the PHP-init-file. So the same goes for the PEAR-mail function (cannot be used).
  • I've tried to use PHP's SwiftMailer. Yet, I struggled to change the information in the header, so I stopped trying with that.
  • I've looked into using MailChimp's PHP API to send out single e-mails to single recipients (which is what it needs to be able to do). But their API doesn't support that.
  • I've considered SendGrid, but I can see that that costs 10 dollars per month, which is kind of expensive, just to be able to send a customer a URL to an invoice... Or that's what I think.
  • I've tried to use PHP's mail-function, where I write the header myself. The header can be seen here:
    Delivered-To: NEWLY-CREATED-GMAIL-ACCOUNT@gmail.com
    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 XXX111@lyobeachcamp.dk) 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 XXX111@lyobeachcamp.dk) smtp.mail=XXX111@lyobeachcamp.dk
    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å 
    XXX222@lyobeachcamp.dk

So my question is this:

  1. Can I either do something really cool that header of mine, to make it pass spam-filters?
  2. Is it possible to somehow send the e-mail from a G-mail account or something, from the PHP-system? I mean, if I made a lyobeachcamp@gmail.com or something like that, and was able to send the e-mails automatically (through my PHP-built system), then I guess that would be easier to get to by-pass spam-filters? Or am I dreaming?
  3. What other options do I have? All I want, is a way that I can get a URL out to one of my customers? I'm even considering sending bottled message, and throw it in the ocean, since there's a bigger chance that they'll get that, than for them to check their spam-filters for it.

Any points in the right direction, suggestions or thoughts are greatly appreciated. I'm quite desperate here!

Thank you for your time.

Krease
  • 15,805
  • 8
  • 54
  • 86
Zeth
  • 2,273
  • 4
  • 43
  • 91
  • problem with share host -you ip's email sending reputation is based on every one else's habits, get a dedicated ip if email sending matters to you. –  Mar 19 '13 at 22:02
  • 1
    Can't change domain records? Can't install pure PHP libraries? Those are fairly unreasonable restrictions. – Álvaro González Mar 19 '13 at 22:05
  • I agree. And $10/mo. is expensive? – landons Mar 19 '13 at 22:08
  • @ÁlvaroG.Vicario - I know that the restrictions are fairly unreasonable. Nevertheless, the whole site and system is up'n'running, and it seems like quite an operation to move the entire site and system, in order to be able to send an e-mail. – Zeth Mar 19 '13 at 22:15
  • @landons - I know that $10/mo isn't a budget-breaking amount. But it's the principle, that it's for something as simple as sending an e-mail; something I do severals times a day for free. It's the same principle that makes me piss in alley-ways instead of public bathrooms, cause I don't want to pay a penny to empty my bladder. :-) – Zeth Mar 19 '13 at 22:16
  • 1
    Who charges you to go to the bathroom?! Too bad there's not an API for that... – landons Mar 19 '13 at 22:18

5 Answers5

4

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.

landons
  • 9,502
  • 3
  • 33
  • 46
  • Ok. Thanks. I'll stop looking for the super spiffy header :-) .
    But are there an external service out there, that allows me to send out e-mails from another service or something. Elaborating: if I could send out an e-mail with MailChimp's API, to a single recipient, then that would be a solution. Do you know any such thing? Does it exist? Is that what SendGrid is?
    – Zeth Mar 19 '13 at 22:02
  • Yes, that's what SendGrid is. I know people who have used it, but I've only used (and thus, can speak) for PostMarkApp myself. Those services can get a bit pricey if you're sending thousands of messages. – landons Mar 19 '13 at 22:03
  • How is the PostMarkApp-API to work with? Cryptic or neat, if I may ask? – Zeth Mar 19 '13 at 22:08
  • Elegant. Great REST API, with numerous libraries to work with: http://developer.postmarkapp.com/developer-libs.html#php-5 – landons Mar 19 '13 at 22:09
  • Also, check the status of your MX Records and if your IP is blacklisted: http://mxtoolbox.com (not a plug). – adamdehaven Apr 03 '13 at 15:08
4

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.

http://sendgrid.com

kuncajs
  • 1,096
  • 1
  • 9
  • 20
  • Hmm.. It looked to me, as if I had to pay to setup the account, but I'll look closer. Thank you. Your blessing for SendGrid means a lot. – Zeth Mar 19 '13 at 22:04
  • I ended up using SendGrid, and it works like a charm. It takes a little bit of time to setup, but it's definitely worth while. At first, my signup wasn't approved (or what it's called), but after contacting them via support-chat, then that error was fixed. I think they are quite hard, when it comes to approving the kind of e-mails you send out - so be rather detailed when filling out those details in the signup. – Zeth Jul 22 '13 at 08:25
  • It's now up to 12k free emails a month! – Kama Jun 22 '16 at 16:01
2

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 = you@yourserver.com

via php.ini & SMTP= - how do you pass username & password

Community
  • 1
  • 1
j_mcnally
  • 6,928
  • 2
  • 31
  • 46
1

There are several good mailer libraries for PHP.

My preferred one is phpMailer.

Spudley
  • 166,037
  • 39
  • 233
  • 307
  • As I wrote in my post, then I can't install phpMailer, since I have to do something in the php.ini-file, which I can't access on One.com's servers. Or am I wrong? Are there another way to use phpMailer without having to do that? – Zeth Mar 19 '13 at 22:05
  • @landons - hehe. it happens to the best of us :-) – Spudley Mar 19 '13 at 22:05
  • @Zeth - phpMailer does not require any work in php.ini. It is a simple download of a handful of PHP code files; not other installation required. It is capable of sending mail via any SMTP server that you have access to, or via gmail, and a few other options. No ini file changes required. – Spudley Mar 19 '13 at 22:08
  • Hmm.. I thought I read otherwise somewhere. Sorry for the misunderstanding. Nevertheless, it isn't that much different to SwiftMailer, is it? It doesn't come with a sick-ass-spam-passing-function(), does it? :-) – Zeth Mar 19 '13 at 22:11
  • @Zeth - no, you're right; they're pretty much equivalents. There's no magic way to get round spam filters. – Spudley Mar 19 '13 at 22:16
0

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

Dave Hogan
  • 3,201
  • 6
  • 29
  • 54
  • yay! i have to say the sendmail default usually only useful in testing and small apps especially if you outgoing mail server isn't configured properly with DNS – j_mcnally Mar 19 '13 at 21:59