471,354 Members | 2,083 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,354 software developers and data experts.

Mail trouble

I believe this question has been asked before, but I haven't found the
solution to it.

I've given up on the php mail() function (doesn't work fast enough for
sending large amounts of HTML mails).

Instead, I'd like to throw all my mails into the mail queue. I'm running
sendmail on freeBSD and imagine that I should be able to use the exec()
command.

Anyone has an idea?

Thanks in advance.

--
bonfils
http://kim.bonfils.com
Jul 17 '05 #1
12 3770
"bonfils" <ki*@bonfils.your.underwear.com> wrote in message
news:3f***********************@dread16.news.tele.d k...
I believe this question has been asked before, but I haven't found the
solution to it.

I've given up on the php mail() function (doesn't work fast enough for
sending large amounts of HTML mails).

Instead, I'd like to throw all my mails into the mail queue. I'm running
sendmail on freeBSD and imagine that I should be able to use the exec()
command.

Anyone has an idea?

Thanks in advance.

--
bonfils
http://kim.bonfils.com


I have serveral idea, each differnt depeing on your needs, how many emails
are you trying to send?
--
Mike Bradley
http://www.gzentools.com -- free online php tools
Jul 17 '05 #2
"CountScubula" <me@scantek.hotmail.com> wrote:
I have serveral idea, each differnt depeing on your needs, how many emails
are you trying to send?


Currently just over a thousand - but of course it would be nice if I didn't
have to worry about the amount.
The script runs fine using the mail() function on plain text emails - it's
HTML emails (around 20 KB) that makes the mail server malfunction.

--
bonfils.
http://kim.bonfils.com
Jul 17 '05 #3
One of the things I do is to add a user to the mail server and in the
/home/username/ directory, create a file called .forward and put all the
email addresses in there. Then simple send an email to the user you just
added, the server will forward it to everyone on that list.

--
Mike Bradley
http://www.gzentools.com -- free online php tools
"bonfils" <ki*@bonfils.my.underwear.com> wrote in message
news:3f***********************@dread15.news.tele.d k...
"CountScubula" <me@scantek.hotmail.com> wrote:
I have serveral idea, each differnt depeing on your needs, how many emails are you trying to send?
Currently just over a thousand - but of course it would be nice if I

didn't have to worry about the amount.
The script runs fine using the mail() function on plain text emails - it's
HTML emails (around 20 KB) that makes the mail server malfunction.

--
bonfils.
http://kim.bonfils.com

Jul 17 '05 #4
Hello,

On 01/09/2004 12:28 PM, bonfils wrote:
I believe this question has been asked before, but I haven't found the
solution to it.

I've given up on the php mail() function (doesn't work fast enough for
sending large amounts of HTML mails).

Instead, I'd like to throw all my mails into the mail queue. I'm running
sendmail on freeBSD and imagine that I should be able to use the exec()
command.

Anyone has an idea?


If you are under Unix/Linux, your problem is most likely that you are
configuring your MTA to try to send messages immediately as opposed to
queue the message for later delivery.

In that case, if you are using sendmail in your server, it would be
better to switch for instance to qmail, but if you can't there are
options to instruct sendmail to defer deliveries until once your queue
is run to process your pending deliveries. This results in much faster
queueing.

You may want to take a look at this class for composing and sending
messages that comes with a sub-class specialized in delivering with
sendmail and has options to tell sendmail to defer your message deliveries.

http://www.phpclasses.org/mimemessage
--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

Jul 17 '05 #5
"bonfils" <ki*@bonfils.your.underwear.com> wrote:
I believe this question has been asked before, but I haven't found the
solution to it.

I've given up on the php mail() function (doesn't work fast enough for
sending large amounts of HTML mails).

Instead, I'd like to throw all my mails into the mail queue. I'm running
sendmail on freeBSD and imagine that I should be able to use the exec()
command.

Anyone has an idea?


First of all: Thanks for your input. You've been very helpful.
However, I haven't had any luck yet.
My latest thought is this: Could this be achieved using the mail() function
and just changing the sendmail_path line in my php.ini file so that it sends
all mails to the queue?
However:

sendmail_path = /usr/sbin/sendmail -odq

doesn't work. The path is correct (it's FreeBSD), but the line above just
makes the mails disappear (not to the queue...)

Any ideas?

--
bonfils
http://kim.bonfils.com
Jul 17 '05 #6
On Mon, 12 Jan 2004 16:11:42 +0100, bonfils wrote:
Instead, I'd like to throw all my mails into the mail queue. I'm running
sendmail on freeBSD and imagine that I should be able to use the exec()
command.

Anyone has an idea?


First of all: Thanks for your input. You've been very helpful. However, I
haven't had any luck yet.
My latest thought is this: Could this be achieved using the mail()
function and just changing the sendmail_path line in my php.ini file so
that it sends all mails to the queue?
However:

sendmail_path = /usr/sbin/sendmail -odq

doesn't work. The path is correct (it's FreeBSD), but the line above just
makes the mails disappear (not to the queue...)

Any ideas?

While I don't particularly like the sound if this "it doesn't send batches
of HTML mail fast enough" (do I smell pork?).. mail() uses sendmail and
also uses the params you define in php.ini so changing that has no actual
input in the way you're after. If you want to use sendmail direct then you
need to feed sendmail itself. As you're on FBSD, try:
$ perldoc -q "How do I send mail?"
Yes it's Perl.. but it's the same method you'd use in PHP to
send mail to sendmail directly.

I'll leave the porting from Perl to PHP as an educational exercise.

Regards,

Ian

--
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.net | forum.digiserv.net
Programming, Web design, development & hosting.

Jul 17 '05 #7
ok, here is another wacky solution.

write a small script that reads a text file of emails, and uses mail to send
them

the from your main script do this:

`php -q mailscript.php addys.txt &`;

this will cause the mailscript.php to run in the background.

--
Mike Bradley
http://www.gzentools.com -- free online php tools
"bonfils" <ki*@bonfils.your.underwear.com> wrote in message
news:3f***********************@dread16.news.tele.d k...
I believe this question has been asked before, but I haven't found the
solution to it.

I've given up on the php mail() function (doesn't work fast enough for
sending large amounts of HTML mails).

Instead, I'd like to throw all my mails into the mail queue. I'm running
sendmail on freeBSD and imagine that I should be able to use the exec()
command.

Anyone has an idea?

Thanks in advance.

--
bonfils
http://kim.bonfils.com

Jul 17 '05 #8
"CountScubula" <me@scantek.hotmail.com> wrote:
ok, here is another wacky solution.

write a small script that reads a text file of emails, and uses mail to send them

the from your main script do this:

`php -q mailscript.php addys.txt &`;

this will cause the mailscript.php to run in the background.


Looks cool. I'll just have to study a bit to find out what the command does.
(Especially the "&")
Problem is, I still have to generate every single email one at a time as it
includes a personal greeting and unsubscribe information. But having the
script run in the background makes sense.

--
bonfils
http://kim.bonfils.com
Jul 17 '05 #9
"bonfils" <ki*@bonfils.your.underwear.com> wrote in message
news:40***********************@dread16.news.tele.d k...
"CountScubula" <me@scantek.hotmail.com> wrote:
ok, here is another wacky solution.

write a small script that reads a text file of emails, and uses mail to send
them

the from your main script do this:

`php -q mailscript.php addys.txt &`;

this will cause the mailscript.php to run in the background.


Looks cool. I'll just have to study a bit to find out what the command

does. (Especially the "&")
Problem is, I still have to generate every single email one at a time as it includes a personal greeting and unsubscribe information. But having the
script run in the background makes sense.

--
bonfils
http://kim.bonfils.com


the `` backticks : runs a shell command

php -q : just runs a script with no headers sent out

& : tells the shell to run this command in background

so,

`php -q scriptname.php addyfile.txt &`;

runs a shell command, php to run scriptname.php and pass the parameter
addyfile.txt, oh, and do this in the background.

--
Mike Bradley
http://www.gzentools.com -- free online php tools
Jul 17 '05 #10
"CountScubula" <me@scantek.hotmail.com> wrote:
the `` backticks : runs a shell command

php -q : just runs a script with no headers sent out

& : tells the shell to run this command in background

so,

`php -q scriptname.php addyfile.txt &`;

runs a shell command, php to run scriptname.php and pass the parameter
addyfile.txt, oh, and do this in the background.


Thanks.

;-)

--
bonfils
http://kim.bonfils.com
Jul 17 '05 #11
I noticed that Message-ID:
<Mu****************@newssvr29.news.prodigy.com> from CountScubula
contained the following:
One of the things I do is to add a user to the mail server and in the
/home/username/ directory, create a file called .forward and put all the
email addresses in there. Then simple send an email to the user you just
added, the server will forward it to everyone on that list.


Not much use if you want to customise the mail though.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #12
"Geoff Berrow" <bl******@ckdog.co.uk> wrote in message
news:1c********************************@4ax.com...
I noticed that Message-ID:
<Mu****************@newssvr29.news.prodigy.com> from CountScubula
contained the following:
One of the things I do is to add a user to the mail server and in the
/home/username/ directory, create a file called .forward and put all the
email addresses in there. Then simple send an email to the user you just
added, the server will forward it to everyone on that list.


Not much use if you want to customise the mail though.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/


This is tru, thats why its simple solution, not a complex, customize to your
needs type of solution

--
Mike Bradley
http://www.gzentools.com -- free online php tools
Jul 17 '05 #13

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by joealey2003 | last post: by
2 posts views Thread by daokfella | last post: by
1 post views Thread by WIzmanG | last post: by
7 posts views Thread by r0g | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.