GMAIL blocking all PHP sent mail


#1

I NEED automated mail to go through to my GMAIL users when sent with PHP mail scripts, however every time they are moved to the SPAM folder in gmail.

I am aware that they can manually go in and find the message, but i dont want to have to tell hundreds of users to do that…

Has anyone managed to make a mail script that will actually be accepted by GMAIL / HOTMAL / etc. ?


#2

maybe you are using normal mail() function.

you can try to use PHPMail class. It is not bad. You need to provide a valid SMTP server, username and password.

check this http://phpmailer.sourceforge.net/

Save [color=#CC0000]$97[/color] (max discount) on dreamhost plans by using promo code: [color=#CC0000]97CRAZY[/color]. Sign Up NOW


#3

tried the phpmailer and still my mails went directly to GMAIL spam box. tried SMTP, mail(), phpmailer, pretty much everything I can think of…

does anyone actually have this working from a Dreamhost account?


#4

I know this might seem obvious, but I just wanted to verify…

Have you checked the e-mail that is being generated? Is there anything that Gmail’s spam filter would object to? Who the e-mail is from, title of the e-mail, content… whatever else?

Rather than being about Gmail blocking mail from Dreamhost, I wonder if it might be Gmail blocking your specific automated e-mails. Because usually when e-mail servers take issue with other domain’s e-mail, it just bounces it, not flags it as spam.

Just my two cents.


#5

yer thanks for the suggestion, but thats not the case.

I get the same result for many different kinds of email.

also the identical email sent manually got through ok.


#6

Mine all work fine. But I have Sender Policy Framework records on my domains as well.


#7

can you please tell me how you made your SPF’s work? I tried but I have no idea how to do it… I would really appreciate your help!


#8

Actually, suddently SPF is also working on my mails too…

Received-SPF: pass (google.com: domain of oldsushi@oldsushi.com designates 66.33.216.244 as permitted sender)

HOWEVER, its still getting caught by my gmail account as spam…

TEZ - please try sending an automated mail to testingphpmail@gmail.com and ill see if it gets through ok. And if so please please please tell me your setup - this is really holding me back at the moment :frowning:


#9

First i’d just stat unblocking them. But here’s my SPFs. It will take a while to update though, day or two.

v=spf1 a mx mx:gmail.com ptr:yourisps.mail.com ptr:dreamhost.com -all


#10

v=spf1 a mx ptr mx:dreamhost.com include:dreamhost.com ~all

this is what im using, still blocked by GMAIL


#11

I just put this on a test page, loaded the page, and the mail went right into my gmail inbox. Leave what’s in bold, change what’s in italics.

<?php
mail('
Your_gmail_name@gmail.com’, ‘Subject Line’, ‘Message body.’, null, '-fyou@example.com’);
?>

I’d guess that it’s either your content, or maybe your specific server IP that’s triggering it.


:stuck_out_tongue: Save up to $96 at Dreamhost with ALMOST97 promo code (I get $1).
Or save $97 with THEFULL97.


#12

Hello and thank you very much for your reply.

I tried it but still went to junk folder.

I suspect you have recieved many mails from yourself in the past, and so GMAIL now trusts your domain, as I get successful mails when sending to a GMAIL account that already ‘trusts’ oldsushi.com - HOWEVER, when i create a brand new gmail account, the mail goes straight to SPAM.

This is a problem since my account activation system will be mailing many people for the first time!

If you wouldnt mind, could you please try sending me a mail to testingphpmail@gmail.com with your automated script thing - if it comes to my inbox, i know its a problem with my account…


#13

just try again with this code.

mail($to_email_address, $message, $subject, “X-Mailer: PHP/” . phpversion() . “\r\n Reply-To: $from_email_address”, “-f From: $from_email_address”);

Save [color=#CC0000]$97[/color] (max discount) on dreamhost plans by using promo code: [color=#CC0000]97CRAZY[/color]. Sign Up NOW


#14

tried and failed. If you think you have yours working, please use it to send a mail to testingphpmail@gmail.com and I will know for sure that it works

Thank you!


#15

hmm… the mail from YapAuction (thank you very much) came through fine by using the phpmailer class instead of standard PHP mail function.

I cannot even get PHPMAILER to send mail - every time it says “Error From mail failed” or something… it never works :frowning: please give me the function that you use to send mail successfully.

Also, looking at the headers of a recieved mail in to GMAIL, why is the message received 3 times from different dreamhost.com mail servers?

Delivered-To: phpmail2@gmail.com
Received: by 10.70.18.14 with SMTP id 14cs56092wxr;
Sat, 3 Mar 2007 22:44:13 -0800 (PST)
Received: by 10.35.20.14 with SMTP id x14mr10468703pyi.1172990653116;
Sat, 03 Mar 2007 22:44:13 -0800 (PST)
Return-Path: oldsushi@oldsushi.com
Received: from pants.dreamhost.com (pants.dreamhost.com [66.33.216.244])
by mx.google.com with ESMTP id 7si6726013nzo.2007.03.03.22.44.12;
Sat, 03 Mar 2007 22:44:13 -0800 (PST)
Received-SPF: pass (google.com: domain of oldsushi@oldsushi.com designates 66.33.216.244 as permitted sender)
Received: from smarty.dreamhost.com (smarty.dreamhost.com [66.33.216.24])
by pants.dreamhost.com (Postfix) with ESMTP id 12CBF2FBC3
for phpmail2@gmail.com; Sat, 3 Mar 2007 22:44:12 -0800 (PST)
Received: from twix.dreamhost.com (twix.dreamhost.com [64.111.114.14])
by smarty.dreamhost.com (Postfix) with ESMTP id 03540EE23C
for phpmail2@gmail.com; Sat, 3 Mar 2007 22:44:12 -0800 (PST)
Received: by twix.dreamhost.com (Postfix, from userid 729925)
id 051A8DCDEC; Sat, 3 Mar 2007 22:44:12 -0800 (PST)
To: phpmail2@gmail.com
Subject: oldSushi.com - Japans fastest growing community
MIME-Version: 1.0
Content-type: text/plain; charset=utf-8
From: oldSushi oldsushi@oldsushi.com
Reply-To: oldsushi@oldsushi.com
X-Sender: oldsushi@oldsushi.com
X-Mailer: PHP v4.4.4
Message-Id: 20070304064412.051A8DCDEC@twix.dreamhost.com
Date: Sat, 3 Mar 2007 22:44:12 -0800 (PST)


#16

I’m glad that PHPMailer is working.

I’ve uploaded a sample code to my server. You can download it from here

Remember to use valid smtp server name, valid user name and password. I used yahoo smtp server to send you the email last time.

Save [color=#CC0000]$97[/color] (max discount) on dreamhost plans by using promo code: [color=#CC0000]97CRAZY[/color]. Sign Up NOW


#17

I hate to resurrect this post from the dead, but I also hate to start a conversation that’s already been started…Has anyone ever found a solution to this “straight to spam folder” issue? I’m having the problem with my new Gmail account, so I’d appreciate ANY help anyone can offer! Thanks in advance!!


#18

I just tested an osTicket installation and left the default system@domain.com (which doesn’t exist) as the email handling account and all mail is going directly to inboxes at GMail using the server’s standard mail() function. Having said that, the above domain’s mail is set up as “GMail Hosted”, so perhaps GMail are allowing it through as legit via some wildcard setup or somesuch.

–edit—

Email is being sent to GMail via Blingy in the above case.

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost