Some recipients do not receive any mail

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
klaasjes
Forum Newbie
Posts: 6
Joined: Sun Dec 21, 2008 5:24 am

Some recipients do not receive any mail

Post by klaasjes »

Hi,
I installed Swiftmailer, it's great! However, a problem occured. While some receivers (Gmail) receive the messages, others don't. Does this mean that those messages are blocked by the mailserver? And can I do something about it?

Thanks!
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Some recipients do not receive any mail

Post by Chris Corbyn »

They're probably being blocked as spam due to IP address blacklisting. If you're on one of the common shared hosts (Amazon EC2 included) this happens regularly.

Try your mail server's IP address here:

http://www.robtex.com/rbl/
klaasjes
Forum Newbie
Posts: 6
Joined: Sun Dec 21, 2008 5:24 am

Re: Some recipients do not receive any mail

Post by klaasjes »

Hmm, I get the following:
http://www.robtex.com/dns/mail.klaasjes.nl.html

Can you say anything about that?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Some recipients do not receive any mail

Post by Chris Corbyn »

All looks fine (you need to click the "Blocklists" tab after a search).

Do you have a SPF record configured? Hotmail requires this for one.
klaasjes
Forum Newbie
Posts: 6
Joined: Sun Dec 21, 2008 5:24 am

Re: Some recipients do not receive any mail

Post by klaasjes »

This is the code I use:

Code: Select all

 
//Load in the files we'll need
require_once "Swift/lib/Swift.php";
require_once "Swift/lib/Swift/Connection/SMTP.php";
 
$swift =& new Swift(new Swift_Connection_SMTP("localhost", 25));
 
$message =& new Swift_Message("My subject", "My body");
$recipients =& new Swift_RecipientList();
$recipients->addTo("klaas@heder.nl", "Zip Button");
$recipients->addTo("k.kox@uvt.nl", "Zip Button");
$recipients->addTo("klaaskox@gmail.com", "Foo Bar");
$recipients->addTo("support@samenbetalen.nl", "Zip Button");
 
$swift->batchsend($message, $recipients, new Swift_Address("info@skish.nl", "Me"));
 
The second and third recipients receive the message, and the first and last do not receive anything.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Some recipients do not receive any mail

Post by Chris Corbyn »

It appears that your domain name does not have a SPF record configured for it. You'll need to add this.

This website will help you do this: http://www.openspf.org/
klaasjes
Forum Newbie
Posts: 6
Joined: Sun Dec 21, 2008 5:24 am

Re: Some recipients do not receive any mail

Post by klaasjes »

Thanks for your help!
I used their validator:

Code: Select all

 
Input accepted, querying now...
 
SPF records are primarily published in DNS as TXT records. The TXT records found for your domain are:
 
v=spf1 a mx ip4:193.138.205.249 ?all
 
 
SPF records should also be published in DNS as type SPF records. This is new and most implementations do not support it yet.
No type SPF records found.
 
Checking to see if there is a valid SPF record.
 
Found v=spf1 record for klaasjes.nl
v=spf1 a mx ip4:193.138.205.249 ?all
 
evaluating...
SPF record passed validation test with pySPF (Python SPF library)!
 
Does this mean that there already is an spf record and that it is valid?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Some recipients do not receive any mail

Post by Chris Corbyn »

Hah, I must have checked the wrong domain. I checked skish.nl and got nothing.

I assume you've just placed "My body" in this code snippet and you are sending an real message?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Some recipients do not receive any mail

Post by Chris Corbyn »

By the way, I still get nothing for that sender address:

Code: Select all

chrisbook:swiftmailer_v4 chris$ dig TXT skish.nl
 
; <<>> DiG 9.4.2-P2 <<>> TXT skish.nl
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53134
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
 
;; QUESTION SECTION:
;skish.nl.          IN  TXT
 
;; ANSWER SECTION:
skish.nl.       14400   IN  TXT "Zone hosted by Medid Webapplications B.V."
 
;; Query time: 667 msec
;; SERVER: 61.9.133.193#53(61.9.133.193)
;; WHEN: Tue Dec 23 20:44:52 2008
;; MSG SIZE  rcvd: 80
 
 
Which domain did you check?
klaasjes
Forum Newbie
Posts: 6
Joined: Sun Dec 21, 2008 5:24 am

Re: Some recipients do not receive any mail

Post by klaasjes »

I checked klaasjes.nl, that is also where my scripts are running
The same problem occurs when the sender is info@klaasjes.nl: some recipients always receive the messages, others never receive anything.
klaasjes
Forum Newbie
Posts: 6
Joined: Sun Dec 21, 2008 5:24 am

Re: Some recipients do not receive any mail

Post by klaasjes »

I'm trying to build a mailing system, and I still need to choose a webhost and register a domain. The system will be used once a month in order to send out a html newsletter to 2000-3000 subscribers. Are there things that I should pay attention to in order to make sure that it will work properly?
For example, should I use a cronjob to split up the recipients in batches? And are there some server requirements that can fix the problems that I described earlier?

Thanks!
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Some recipients do not receive any mail

Post by Chris Corbyn »

It's hard for me to determine the cause of the junk filtering here... I can only suggest trying a different host - it's most likely to do with the origin of the email.

In terms of dealing with 2000-3000 recipients, it's wise to batch them into groups of 100 or so (using cron, yes) but in reality 3000 is not a massive amount. The main concern is that you'll overload the SMTP server. Companies that send out 100K+ emails tend to have multiple SMTP servers that they can spread the work across.
Post Reply