From: "Bob McConnell" on
From: ash(a)ashleysheridan.co.uk

> Could it be that there are connection limits on the remote server?
>
> Thanks,
> Ash

Only if you are opening a new connection for each message. Any decent
SMTP client should be able to send multiple messages over a single
connection.

You could capture the traffic with Wireshark. Set the capture filter to
only grab SMTP traffic to that server's IP address. Unless it is going
through SSL/TLS, you can read the handshake messages. They will look
something like this:

-----8<--------------------------------
220 lists.php.net ESMTP Postfix
EHLO ashleysheridan.co.uk
250-mail.php.net
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH LOGIN PLAIN
250 8BITMIME
MAIL FROM:<ash(a)ashleysheridan.co.uk>
250 Ok
RCPT TO:<php-general(a)lists.php.net>
250 Ok
-----8<--------------------------------

The lines beginning with numbers are the server's responses. All of them
should be ASCII/UTF-8 text.

There is one other possibility. According to the RFCs, the standard line
ending for email is CRLF. Make sure your system is sending both
characters after each line. There is a slim chance the server is cutting
you off after some number of bytes if you are only sending a LF.

Bob McConnell
From: Dave M G on
Ash, Bob,

Thank you for replying.

> There is one other possibility. According to the RFCs, the standard line
> ending for email is CRLF. Make sure your system is sending both
> characters after each line. There is a slim chance the server is cutting
> you off after some number of bytes if you are only sending a LF.

This is actually a possiblity. I think I might be only using LF.

Some of the text being sent in the emails is entered via a form on a web
page. Is it possible to enforce CRLF on that text?

--
Dave M G
From: "Bob McConnell" on
From: Dave M G

>> There is one other possibility. According to the RFCs, the standard
line
>> ending for email is CRLF. Make sure your system is sending both
>> characters after each line. There is a slim chance the server is
cutting
>> you off after some number of bytes if you are only sending a LF.
>
> This is actually a possiblity. I think I might be only using LF.
>
> Some of the text being sent in the emails is entered via a form on a
web
> page. Is it possible to enforce CRLF on that text?

You would have to scan the text when you process the form and replace
any bare LF you find with CRLF. The string sequence for that would be
"\r\n". It shouldn't be too difficult to come up with a regular
expression to find any LF not preceded by a CR and replace it.

Also, check your mail library to make sure it defines $EOL correctly as
well. I reported that as a bug in PHPMailer a while back. If it is
correct, it may actually fix the bare LF's for you.

Bob McConnell
From: Dave M G on
Peter, Bob,

Thank you for replying.

After a few days testing, I set up an error handler for when messages
don't get sent. I started to see an error saying "Language String failed
to load", which seems to be particular to the PHPmailer scripts I am using.

Long story short, after some searching on the web, it looks like the
sending of mails will die if one mail on the list is invalid.

I tried sending a message out to the list, got back a response saying
that the recipient did not exist. So I deleted that user, and then the
mail went through fine on the next attempt.

I'm a little fuzzy on what exactly is happening.

Does the PHP mail() command (and by extension, classes built upon it)
listen for responses from the server it is sending to?

--
Dave M G