Re: [PHP] php mail() function and ezmlm

2010-01-13 Thread vikash . iitb
Can you send it to other email addresses?

--
Vikash Kumar
http://vika.sh

On Thu, Jan 14, 2010 at 12:16 PM, Bob Strasser wrote:

> I'm having trouble sending info from a form to the list-subscr...@domain
> Does anyone know why ezmlm doesn't recognize the mail() function?
>
>


Re: [PHP] php mail() function

2009-11-25 Thread James Prentice
It looks like using XAMPP wasn't strictly necessary. I tried running
this example again using my previous versions of mysql and apache and
it worked fine. So the key is to configure Sendmail as described at
the URL I gave.

On Wed, Nov 25, 2009 at 10:58 AM, James Prentice  wrote:
> After a long delay, I've finally got mail working. I had decided to
> move on in the book that I'm working through (Head First PHP & MySQL)
> but doubled back to address the mail issue again. This is how I
> finally got it to work:
>
> 1. Switched to XAMPP for linux rather than using my existing versions
> of mysql, php and apache.
>
> 2. Uninstalled Postfix and reinstalled Sendmail. Then I followed the
> instructions here:
>
> http://dbaron.org/linux/sendmail
>
> I can't vouch that the method described at that link is completely
> safe and secure, but it worked for me and was very easy. I've spent
> many hours and days trying to get this to work so am very relieved.
>
> My only complaint is that there is quite a long delay after submitting
> report.html (from Ch. 1) while it says 'waiting for localhost...'. It
> can take up to 20 seconds or so before sending and giving
> confirmation.
>
> Thanks for all your help.
>
> On Mon, Oct 26, 2009 at 4:37 AM, Bob McConnell  wrote:
>> From: James Prentice
>>
>>> I have tried setting both $to and $email to be the same shaw address
>>> since I assumed it should be recognized by the mail server, but it's
>>> still getting bounced. So why is 'www-d...@homemade' being listed as
>>> the sender? Any ideas?
>>
>> I strongly recommend you call the help desk at Shaw and ask them to
>> explain what is happening. They should know what is going on with their
>> servers. Everyone on this list appears to be guessing at the problem,
>> which is not likely to help you.
>>
>> Bob McConnell
>>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php mail() function

2009-11-25 Thread James Prentice
After a long delay, I've finally got mail working. I had decided to
move on in the book that I'm working through (Head First PHP & MySQL)
but doubled back to address the mail issue again. This is how I
finally got it to work:

1. Switched to XAMPP for linux rather than using my existing versions
of mysql, php and apache.

2. Uninstalled Postfix and reinstalled Sendmail. Then I followed the
instructions here:

http://dbaron.org/linux/sendmail

I can't vouch that the method described at that link is completely
safe and secure, but it worked for me and was very easy. I've spent
many hours and days trying to get this to work so am very relieved.

My only complaint is that there is quite a long delay after submitting
report.html (from Ch. 1) while it says 'waiting for localhost...'. It
can take up to 20 seconds or so before sending and giving
confirmation.

Thanks for all your help.

On Mon, Oct 26, 2009 at 4:37 AM, Bob McConnell  wrote:
> From: James Prentice
>
>> I have tried setting both $to and $email to be the same shaw address
>> since I assumed it should be recognized by the mail server, but it's
>> still getting bounced. So why is 'www-d...@homemade' being listed as
>> the sender? Any ideas?
>
> I strongly recommend you call the help desk at Shaw and ask them to
> explain what is happening. They should know what is going on with their
> servers. Everyone on this list appears to be guessing at the problem,
> which is not likely to help you.
>
> Bob McConnell
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php mail() function

2009-10-26 Thread John Black

Bob McConnell wrote:

I strongly recommend you call the help desk at Shaw and ask them to
explain what is happening. They should know what is going on with their
servers. Everyone on this list appears to be guessing at the problem,
which is not likely to help you.


But they are educated guesses :)

No seriously, without a definitive error message it is hard to say for sure.
Since he only needs postfix on the server to allow php to email out I 
may have a different solution for him.
I sent him my custom smtp_email function which talks to the ISPs SMTP 
server directly and supports authentication.

Lets see if that help.

--
John
Nur wer im Wohlstand lebt, schimpft auf ihn.
[Ludwig Marcuse]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] php mail() function

2009-10-26 Thread Bob McConnell
From: James Prentice

> I have tried setting both $to and $email to be the same shaw address
> since I assumed it should be recognized by the mail server, but it's
> still getting bounced. So why is 'www-d...@homemade' being listed as
> the sender? Any ideas?

I strongly recommend you call the help desk at Shaw and ask them to
explain what is happening. They should know what is going on with their
servers. Everyone on this list appears to be guessing at the problem,
which is not likely to help you.

Bob McConnell

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php mail() function

2009-10-24 Thread James Prentice
But it seems like the 'From:' address being given to the PHP mail()
function is maybe being ignored, because the error log lists
'www-d...@homemade' as being the sender, rather than listing the shaw
address.

The snippet from the PHP code:

$email = $_POST['email'];
...
mail($to, $subject, $msg, 'From:' . $email);

I have tried setting both $to and $email to be the same shaw address
since I assumed it should be recognized by the mail server, but it's
still getting bounced. So why is 'www-d...@homemade' being listed as
the sender? Any ideas?


On Sat, Oct 24, 2009 at 9:17 PM, James Prentice  wrote:
> I also suspect that the problem is due to the sender address, but I
> have tried using the shaw email address for the From: address that's
> given to the mail() function and it still gets bounced. It seems like
> the ISP should consider that address valid.
>
>
>
> On Sat, Oct 24, 2009 at 2:20 PM, Per olof Ljungmark  wrote:
>> James Prentice wrote:
>>>
>>> It sends the bounced message to /var/mail/www-data and I get this:
>>>
>>> --19BE8A70109.1256417846/homemade
>>> Content-Description: Delivery report
>>> Content-Type: message/delivery-status
>>>
>>> Reporting-MTA: dns; homemade
>>> X-Postfix-Queue-ID: 19BE8A70109
>>> X-Postfix-Sender: rfc822; www-d...@homemade
>>> Arrival-Date: Sat, 24 Oct 2009 13:57:26 -0700 (PDT)
>>>
>>> Final-Recipient: rfc822; x...@shaw.ca
>>> Action: failed
>>> Status: 5.0.0
>>> Diagnostic-Code: X-Postfix; shawmail.vc.shawcable.net
>>>
>>> --19BE8A70109.1256417846/homemade
>>> Content-Description: Undelivered Message
>>> Content-Type: message/rfc822
>>>
>>> Received: by homemade (Postfix, from userid 33)
>>>        id 19BE8A70109; Sat, 24 Oct 2009 13:57:26 -0700 (PDT)
>>> To: x...@shaw.ca
>>
>> Although 5.0.0 actually means something else I'm pretty sure you are
>> rejected because of an invalid sender address or domain. Use a sender
>> address that is valid with your ISP's mail relay.
>>
>> Just my $0.02
>>
>> --
>> per
>>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php mail() function

2009-10-24 Thread James Prentice
I also suspect that the problem is due to the sender address, but I
have tried using the shaw email address for the From: address that's
given to the mail() function and it still gets bounced. It seems like
the ISP should consider that address valid.



On Sat, Oct 24, 2009 at 2:20 PM, Per olof Ljungmark  wrote:
> James Prentice wrote:
>>
>> It sends the bounced message to /var/mail/www-data and I get this:
>>
>> --19BE8A70109.1256417846/homemade
>> Content-Description: Delivery report
>> Content-Type: message/delivery-status
>>
>> Reporting-MTA: dns; homemade
>> X-Postfix-Queue-ID: 19BE8A70109
>> X-Postfix-Sender: rfc822; www-d...@homemade
>> Arrival-Date: Sat, 24 Oct 2009 13:57:26 -0700 (PDT)
>>
>> Final-Recipient: rfc822; x...@shaw.ca
>> Action: failed
>> Status: 5.0.0
>> Diagnostic-Code: X-Postfix; shawmail.vc.shawcable.net
>>
>> --19BE8A70109.1256417846/homemade
>> Content-Description: Undelivered Message
>> Content-Type: message/rfc822
>>
>> Received: by homemade (Postfix, from userid 33)
>>        id 19BE8A70109; Sat, 24 Oct 2009 13:57:26 -0700 (PDT)
>> To: x...@shaw.ca
>
> Although 5.0.0 actually means something else I'm pretty sure you are
> rejected because of an invalid sender address or domain. Use a sender
> address that is valid with your ISP's mail relay.
>
> Just my $0.02
>
> --
> per
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php mail() function

2009-10-24 Thread Per olof Ljungmark

James Prentice wrote:

It sends the bounced message to /var/mail/www-data and I get this:

--19BE8A70109.1256417846/homemade
Content-Description: Delivery report
Content-Type: message/delivery-status

Reporting-MTA: dns; homemade
X-Postfix-Queue-ID: 19BE8A70109
X-Postfix-Sender: rfc822; www-d...@homemade
Arrival-Date: Sat, 24 Oct 2009 13:57:26 -0700 (PDT)

Final-Recipient: rfc822; x...@shaw.ca
Action: failed
Status: 5.0.0
Diagnostic-Code: X-Postfix; shawmail.vc.shawcable.net

--19BE8A70109.1256417846/homemade
Content-Description: Undelivered Message
Content-Type: message/rfc822

Received: by homemade (Postfix, from userid 33)
id 19BE8A70109; Sat, 24 Oct 2009 13:57:26 -0700 (PDT)
To: x...@shaw.ca


Although 5.0.0 actually means something else I'm pretty sure you are 
rejected because of an invalid sender address or domain. Use a sender 
address that is valid with your ISP's mail relay.


Just my $0.02

--
per

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php mail() function

2009-10-24 Thread James Prentice
It sends the bounced message to /var/mail/www-data and I get this:

--19BE8A70109.1256417846/homemade
Content-Description: Delivery report
Content-Type: message/delivery-status

Reporting-MTA: dns; homemade
X-Postfix-Queue-ID: 19BE8A70109
X-Postfix-Sender: rfc822; www-d...@homemade
Arrival-Date: Sat, 24 Oct 2009 13:57:26 -0700 (PDT)

Final-Recipient: rfc822; x...@shaw.ca
Action: failed
Status: 5.0.0
Diagnostic-Code: X-Postfix; shawmail.vc.shawcable.net

--19BE8A70109.1256417846/homemade
Content-Description: Undelivered Message
Content-Type: message/rfc822

Received: by homemade (Postfix, from userid 33)
id 19BE8A70109; Sat, 24 Oct 2009 13:57:26 -0700 (PDT)
To: x...@shaw.ca

I will investigate how to change the loglevel of postfix, because
right now the error messages don't seem very helpful (at least to me).
Cheers

On Sat, Oct 24, 2009 at 1:27 PM, John Black
 wrote:
> James Prentice wrote:
>  > Also, I notice that in the mail.log file, the 'from:' value is
>>
>> 'www-d...@homemade'. The actual 'from:' value is provided to the php
>> mail() function via a web form, so should be somebody's email address
>> (e.g. my own in this case).
>
> I think PHP will use the apache user and domain to generate the email
> address. I use my own smtp function so I can't say for certain.
>
> One thing you could try is to use a valid email account on the server for
> the FROM address so that you can receive the bounced message. The actual
> message should contain more information.
> Alternatively attempt to increase the loglevel of postfix so you get exact
> feedback of why the connection is failing.
>
> As far as which server to use. I think this page lists the correct one:
> http://www.shaw.ca/en-ca/CustomerCare/InternetSupport/Residential/RoutersandShawServerNames.htm
>
> --
> John
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php mail() function

2009-10-24 Thread John Black

James Prentice wrote:
 > Also, I notice that in the mail.log file, the 'from:' value is

'www-d...@homemade'. The actual 'from:' value is provided to the php
mail() function via a web form, so should be somebody's email address
(e.g. my own in this case).


I think PHP will use the apache user and domain to generate the email 
address. I use my own smtp function so I can't say for certain.


One thing you could try is to use a valid email account on the server 
for the FROM address so that you can receive the bounced message. The 
actual message should contain more information.
Alternatively attempt to increase the loglevel of postfix so you get 
exact feedback of why the connection is failing.


As far as which server to use. I think this page lists the correct one:
http://www.shaw.ca/en-ca/CustomerCare/InternetSupport/Residential/RoutersandShawServerNames.htm

--
John

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php mail() function

2009-10-24 Thread James Prentice
Thanks, John. I set up the sasl_passwd file as per your instructions
but am still getting status=bounced. I'm wondering, what should the
values in main.cf be for 'myhostname' and 'mydestination'?

These pages give some info on the Shaw mail servers, but I'm not
certain which I should be using:

http://www.shaw.ca/en-ca/CustomerCare/InternetSupport/Residential/Email/ServiceDetails.htm

http://www.shaw.ca/en-ca/CustomerCare/InternetSupport/Residential/RoutersandShawServerNames.htm

Also, I notice that in the mail.log file, the 'from:' value is
'www-d...@homemade'. The actual 'from:' value is provided to the php
mail() function via a web form, so should be somebody's email address
(e.g. my own in this case).


from=, size=523, nrcpt=1 (queue active)
Oct 24 12:49:40 homemade postfix/error[7530]: B80B7A70109:
to=, relay=none, delay=0.04, delays=0.03/0/0/0.01,
dsn=5.0.0, status=bounced (shawmail)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php mail() function

2009-10-24 Thread John Black

Paul M Foster wrote:
 > 4. All due respect to Kranthi, but I believe he's wrong about relaying

mail from your webserver to the ISP's mailserver. I believe the ISP's
mailserver doesn't care, as long as the mail comes from your "pipe". You
could probably call yourself "pi...@pepperoni.com" and your ISP would
accept it. It's just the From:. Again, I could be wrong.


All the ISPs I have used so far require the user to authenticate even 
when on the same network.
So if you want to relay through the SMTP server of your ISP you need to 
login first. I think that is what Kranthi said


Try this:
1) Set up a password maps file (/etc/postfix/sasl_passwd) with the content:
mail.ispserver.comusername:password

Now Execute these commands
# chown root:root /etc/postfix/sasl_passwd
# chmod 600 /etc/postfix/sasl_passwd
# postmap /etc/postfix/sasl_passwd

And change your config to this /etc/postfix/main.cf:
relayhost = mail.ispserver.com
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous

Now reload postfix and try it again.
# postfix reload

--
John
Question / Answer based CAPTCHA
http://www.network-technologies.org/tiny.php?id=1

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php mail() function

2009-10-23 Thread Paul M Foster
On Fri, Oct 23, 2009 at 09:11:25PM -0700, James Prentice wrote:

> I found the mail server for my ISP (shawmail.vc.shawcable.net) and
> edited main.cf in the following manner:
> 
> myhostname = shawcable.net
> relayhost = [shawmail.vc.shawcable.net]
> 
> I still don't receive the mail from the PHP script though. The error
> log from /var/log/mail.log is this:
> 
> Oct 23 21:00:31 homemade postfix/pickup[7044]: 6CA44A70109: uid=33
> from=
> Oct 23 21:00:31 homemade postfix/cleanup[7107]: 6CA44A70109:
> message-id=<20091024040031.6ca44a70...@shawcable.net>
> Oct 23 21:00:31 homemade postfix/qmgr[7045]: 6CA44A70109:
> from=, size=527, nrcpt=1 (queue active)
> Oct 23 21:00:31 homemade postfix/error[7109]: 6CA44A70109:
> to=, relay=none, delay=0.04, delays=0.03/0/0/0.01,
> dsn=5.0.0, status=bounced ([shawmail.vc.shawcable.net])
> Oct 23 21:00:31 homemade postfix/cleanup[7107]: 75517A7010A:
> message-id=<20091024040031.75517a70...@shawcable.net>
> Oct 23 21:00:31 homemade postfix/bounce[7110]: 6CA44A70109: sender
> non-delivery notification: 75517A7010A
> Oct 23 21:00:31 homemade postfix/qmgr[7045]: 75517A7010A: from=<>,
> size=2219, nrcpt=1 (queue active)
> Oct 23 21:00:31 homemade postfix/qmgr[7045]: 6CA44A70109: removed
> Oct 23 21:00:31 homemade postfix/error[7109]: 75517A7010A:
> to=, relay=none, delay=0.03,
> delays=0.02/0/0/0.01, dsn=5.0.0, status=bounced
> ([shawmail.vc.shawcable.net])
> Oct 23 21:00:31 homemade postfix/qmgr[7045]: 75517A7010A: removed
> 
> Have I edited main.cf incorrectly, or are there other values that need
> to be edited?

1. Not sure why you have square brackets around the relayhost value.

2. You're getting a bounce from the ISP's mail server, one indicating it
still won't allow relay.

3. I suspect the relayhost name is wrong. This may be the name you find
in the mail headers on messages relayed to you, but I doubt it's the one
you should use to post to. I could be wrong, though.

4. All due respect to Kranthi, but I believe he's wrong about relaying
mail from your webserver to the ISP's mailserver. I believe the ISP's
mailserver doesn't care, as long as the mail comes from your "pipe". You
could probably call yourself "pi...@pepperoni.com" and your ISP would
accept it. It's just the From:. Again, I could be wrong.

5. This would be a lot simpler if you just call Shaw and ask them for
the name of the mailserver, and ask them if it's a problem for you to
post mail from your internal webserver to their mailserver. Then ask
them why such posts might bounce with a 5XX error.

Paul

Paul

-- 
Paul M. Foster

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php mail() function

2009-10-23 Thread kranthi
i never worked with postfix, but form my experience with hmail server
i can say that you need to relay through a mail account of ISP(not the
server itself)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php mail() function

2009-10-23 Thread James Prentice
I found the mail server for my ISP (shawmail.vc.shawcable.net) and
edited main.cf in the following manner:

myhostname = shawcable.net
relayhost = [shawmail.vc.shawcable.net]

I still don't receive the mail from the PHP script though. The error
log from /var/log/mail.log is this:

Oct 23 21:00:31 homemade postfix/pickup[7044]: 6CA44A70109: uid=33
from=
Oct 23 21:00:31 homemade postfix/cleanup[7107]: 6CA44A70109:
message-id=<20091024040031.6ca44a70...@shawcable.net>
Oct 23 21:00:31 homemade postfix/qmgr[7045]: 6CA44A70109:
from=, size=527, nrcpt=1 (queue active)
Oct 23 21:00:31 homemade postfix/error[7109]: 6CA44A70109:
to=, relay=none, delay=0.04, delays=0.03/0/0/0.01,
dsn=5.0.0, status=bounced ([shawmail.vc.shawcable.net])
Oct 23 21:00:31 homemade postfix/cleanup[7107]: 75517A7010A:
message-id=<20091024040031.75517a70...@shawcable.net>
Oct 23 21:00:31 homemade postfix/bounce[7110]: 6CA44A70109: sender
non-delivery notification: 75517A7010A
Oct 23 21:00:31 homemade postfix/qmgr[7045]: 75517A7010A: from=<>,
size=2219, nrcpt=1 (queue active)
Oct 23 21:00:31 homemade postfix/qmgr[7045]: 6CA44A70109: removed
Oct 23 21:00:31 homemade postfix/error[7109]: 75517A7010A:
to=, relay=none, delay=0.03,
delays=0.02/0/0/0.01, dsn=5.0.0, status=bounced
([shawmail.vc.shawcable.net])
Oct 23 21:00:31 homemade postfix/qmgr[7045]: 75517A7010A: removed

Have I edited main.cf incorrectly, or are there other values that need
to be edited?
Cheers

On Thu, Oct 22, 2009 at 6:24 PM, James Prentice  wrote:
> How would I determine my ISP's SMPT server ID? And do I need to edit
> main.cf in order to use that server?
>
> Also, is there a way to test the script just sending an email locally?
> I tried sending the email to use...@localhost, but the email was still
> not received.
>
>
>
> On Thu, Oct 22, 2009 at 4:15 PM, LinuxManMikeC  
> wrote:
>> The problem is you won't be trusted to deliver mail directly to most
>> mail servers unless you have a static IP.  Even then thats no
>> guarantee.  What you have to do is relay through your ISP's SMTP
>> server where you're "trusted".  You should also be able to setup PHP
>> to use your ISP's SMTP server and never touch the SMTP service on your
>> local machine (if you don't feel like playing with Postfix).
>>
>> On Thu, Oct 22, 2009 at 3:56 PM, James Prentice  
>> wrote:
>>> I'm trying to use the php mail() function to send a mail within a php
>>> script. This is using PHP 5.2.4 and Ubuntu Hardy Heron linux. The
>>> script runs fine and the return value of the mail function is TRUE,
>>> but the mail is never received. I'm trying to send an email to my
>>> gmail account via the local server on my machine, just to test if this
>>> script works.
>>>
>>> I installed postfix because I read in several places that people have
>>> had good luck with that mail program. From what I can tell, postfix is
>>> working. I can do:
>>>
>>> telnet localhost 25
>>> Trying 127.0.0.1...
>>> Connected to localhost.
>>> Escape character is '^]'.
>>> 220 homemade ESMTP Postfix (Ubuntu)
>>> ehlo localhost
>>> 250-homemade
>>> 250-PIPELINING
>>> 250-SIZE 1024
>>> 250-VRFY
>>> 250-ETRN
>>> 250-STARTTLS
>>> 250-ENHANCEDSTATUSCODES
>>> 250-8BITMIME
>>> 250 DSN
>>>
>>> After the php script runs, I type 'mailq' and get the result 'mail
>>> queue is empty.' If I check /var/log/mail.log, this is what I see:
>>>
>>> Oct 21 23:54:35 homemade postfix/pickup[5735]: 2A31EA70109: uid=33
>>> from=
>>> Oct 21 23:54:35 homemade postfix/cleanup[7997]: 2A31EA70109:
>>> message-id=<20091022065435.2a31ea70...@homemade>
>>> Oct 21 23:54:35 homemade postfix/qmgr[5736]: 2A31EA70109:
>>> from=, size=499, nrcpt=1 (queue active)
>>> Oct 21 23:54:35 homemade postfix/error[7999]: 2A31EA70109:
>>> to=, relay=none, delay=0.04, delays=0.03/0/0/0.01,
>>> dsn=5.0.0, status=bounced (gmail.com)
>>> Oct 21 23:54:35 homemade postfix/cleanup[7997]: 3217DA7010A:
>>> message-id=<20091022065435.3217da70...@homemade>
>>> Oct 21 23:54:35 homemade postfix/qmgr[5736]: 3217DA7010A: from=<>,
>>> size=2095, nrcpt=1 (queue active)
>>> Oct 21 23:54:35 homemade postfix/bounce[8000]: 2A31EA70109: sender
>>> non-delivery notification: 3217DA7010A
>>> Oct 21 23:54:35 homemade postfix/qmgr[5736]: 2A31EA70109: removed
>>> Oct 21 23:54:35 homemade postfix/local[8001]: 3217DA7010A:
>>> to=, relay=local, delay=0.03, delays=0/0.02/0/0.01,
>>> dsn=2.0.0, status=sent (delivered to command: procmail -a
>>> "$EXTENSION")
>>> Oct 21 23:54:35 homemade postfix/qmgr[5736]: 3217DA7010A: removed
>>>
>>> Any ideas? I am new both to php and postfix. Thanks for any help.
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] php mail() function

2009-10-23 Thread Bob McConnell
From: Paul M Foster

> Regarding the rejection of dynamic IPs by smarthosts, are you saying
> that it's a "blacklist" of sorts that lets them know an IP is dynamic?
> (Serious question. I don't know the mechanism by which they determine
> what is and isn't a dynamic IP.)

You are talking about two different mechanisms here. The black or grey
lists are services that track known open relays and other sources of
spam, viruses and assorted malware. Anyone can subscribe to them and use
them to validate relay requests.

There are also services that keep track of valid domain addresses and
the IP assigned to them. They are usually called DNS hosts. These can be
polled to identify the IP address for authorized domains and hosts.
There are even special records for the email severs within a domain.
Most dynamically allocated IP addresses will not show up on these
servers unless you have access to a service authorized to inject
records.

So basically, qmail did a DNS lookup on your host/domain name and did
not find a record pointing to your server. Therefore it rejected your
request.

You will have to ask your ISP for the address of their SMTP and POP
servers if you don't know them. But usually your email client is already
configured to talk to them. I would just go into my Thunderbird setup
and look up those addresses.

Bob McConnell

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php mail() function

2009-10-23 Thread John Black

Paul M Foster wrote:

Regarding the rejection of dynamic IPs by smarthosts, are you saying
that it's a "blacklist" of sorts that lets them know an IP is dynamic?
(Serious question. I don't know the mechanism by which they determine
what is and isn't a dynamic IP.)


I run my own mail server and use the zen blocklist from spamhaus.org. 
The zen list combines all the the anti spam lists plus all IPs 
designated to end users (http://www.spamhaus.org/zen/)


The reason for blocking end users is that a lot of SPAM is sent out by 
compromised machines from some home Internet connection. I am currently 
getting about 5 connections every 2 seconds from compromised computers 
attempting to spam my server. The origin is usually a dynamically 
assigned IP from Sprint or Comcast (USA ISPs).
So blocking the end users from sending SPAM tends to cut down on a LOT 
of junk.


Here is a bit more info about the end user blocklist.
http://www.spamhaus.org/pbl/

--
John
Question / Answer based CAPTCHA
http://www.network-technologies.org/tiny.php?id=1

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php mail() function

2009-10-22 Thread kranthi
i faced the same problem quite a few times.

the general email route is
php script -> sender smtp server -> receiving mail server
in your case path 2 is broken. meaning port 25 is blocked by your ISP

the work around is:
1. see if your ISP provides you with an SMTP account that is not blocked (OR)
2. try using a socks

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php mail() function

2009-10-22 Thread Paul M Foster
On Thu, Oct 22, 2009 at 11:40:34PM -0500, Shawn McKenzie wrote:



> This is fairly accurate in premise but just to clarify.  Mailservers
> don't operate like this by default and there is really no "trust".
> There are public blacklists that a mailserver can be configured to use
> that tell the mailserver not to accept mail from servers on the
> blacklist.  The blacklists may contain servers that allow anyone to
> relay email, compromised servers, servers known for spam, ip ranges
> known to be held by spammers and *ranges that ISPs designate as dynamic
> or used for subscribers (DSL, cable, dial-up customers, etc. because
> they shouldn't be relaying email).

Regarding the rejection of dynamic IPs by smarthosts, are you saying
that it's a "blacklist" of sorts that lets them know an IP is dynamic?
(Serious question. I don't know the mechanism by which they determine
what is and isn't a dynamic IP.)

Paul

-- 
Paul M. Foster

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php mail() function

2009-10-22 Thread Shawn McKenzie
Paul M Foster wrote:
> On Thu, Oct 22, 2009 at 06:24:14PM -0700, James Prentice wrote:
> 
> One other note. People look at me like I'm crazy when I mention this,
> but I've seen it quite a bit at various internet mail servers.
> Sometimes, in order to accept email from you, the internet mail server
> must see you *receive* mail within a certain time period prior. That is,
> you have to go fetch your mail at the ISP, which opens a "window" into
> the SMTP server for a limited time. Then you can tender mail to the
> internet mail server. I don't know that your internet mail server
> operates this way, but it's something to consider. I've had to deal with
> this before myself.

This is commonly known as POP lock and is one of the two main ways that
a mail server allows you to relay a message.  If you have authenticated
via POP3 (i.e. checked your mail) in a certain period of time then the
SMTP server will let you send.  The other main one is by authentication
(username/password) with the SMTP server when you attempt to send mail.

> In any case, linuxmanmikec's comment about the internet mail server not
> trusting you on a dynamic IP is spot on. The web of email trust is such
> that internet mail servers only trust other internet mail servers. And
> *your* internet mail server will trust *you*. So to get mail to that
> other internet mail server over there, you'll have to give it to *your*
> internet mail server, which is the only one that internet mail server
> over there will trust. The "bounce" message you got indicates that
> relaying from you is forbidden at the destination mail server.
> 

This is fairly accurate in premise but just to clarify.  Mailservers
don't operate like this by default and there is really no "trust".
There are public blacklists that a mailserver can be configured to use
that tell the mailserver not to accept mail from servers on the
blacklist.  The blacklists may contain servers that allow anyone to
relay email, compromised servers, servers known for spam, ip ranges
known to be held by spammers and *ranges that ISPs designate as dynamic
or used for subscribers (DSL, cable, dial-up customers, etc. because
they shouldn't be relaying email).

-- 
Thanks!
-Shawn
http://www.spidean.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php mail() function

2009-10-22 Thread Paul M Foster
On Thu, Oct 22, 2009 at 06:24:14PM -0700, James Prentice wrote:

> How would I determine my ISP's SMPT server ID? And do I need to edit
> main.cf in order to use that server?

What ID? There's no ID needed. You just configure postfix to relay any
non-local mail sent to it to the SMTP server at your ISP. Check the
headers in incoming mail sent to you for the name of that server. It's
likely the same for both incoming and outgoing mail. Something like
mail.myisp.com.

One other note. People look at me like I'm crazy when I mention this,
but I've seen it quite a bit at various internet mail servers.
Sometimes, in order to accept email from you, the internet mail server
must see you *receive* mail within a certain time period prior. That is,
you have to go fetch your mail at the ISP, which opens a "window" into
the SMTP server for a limited time. Then you can tender mail to the
internet mail server. I don't know that your internet mail server
operates this way, but it's something to consider. I've had to deal with
this before myself.

Configuring local SMTP servers, like postfix. Check and see if Ubuntu
has some sort of setup utility for this. Or try

dpkg-reconfigure postfix

Setting up mail servers is tedious and error prone, unless you've done
it a lot. Read The Fine Manual on postfix.

> 
> Also, is there a way to test the script just sending an email locally?
> I tried sending the email to use...@localhost, but the email was still
> not received.
> 

It will work, assuming three things:

1. You have an actual user set up on the system to receive mail. That
is, an actual user on the system, with an entry in the passwd file and a
home directory, etc.

2. Postfix is configured to deliver truly local mail to local addresses.
More postfix configuration fun.

3. Postfix is actually running and properly configured. If not
configured properly, it may refuse to run.

In any case, linuxmanmikec's comment about the internet mail server not
trusting you on a dynamic IP is spot on. The web of email trust is such
that internet mail servers only trust other internet mail servers. And
*your* internet mail server will trust *you*. So to get mail to that
other internet mail server over there, you'll have to give it to *your*
internet mail server, which is the only one that internet mail server
over there will trust. The "bounce" message you got indicates that
relaying from you is forbidden at the destination mail server.

Paul

-- 
Paul M. Foster

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php mail() function

2009-10-22 Thread James Prentice
How would I determine my ISP's SMPT server ID? And do I need to edit
main.cf in order to use that server?

Also, is there a way to test the script just sending an email locally?
I tried sending the email to use...@localhost, but the email was still
not received.



On Thu, Oct 22, 2009 at 4:15 PM, LinuxManMikeC  wrote:
> The problem is you won't be trusted to deliver mail directly to most
> mail servers unless you have a static IP.  Even then thats no
> guarantee.  What you have to do is relay through your ISP's SMTP
> server where you're "trusted".  You should also be able to setup PHP
> to use your ISP's SMTP server and never touch the SMTP service on your
> local machine (if you don't feel like playing with Postfix).
>
> On Thu, Oct 22, 2009 at 3:56 PM, James Prentice  
> wrote:
>> I'm trying to use the php mail() function to send a mail within a php
>> script. This is using PHP 5.2.4 and Ubuntu Hardy Heron linux. The
>> script runs fine and the return value of the mail function is TRUE,
>> but the mail is never received. I'm trying to send an email to my
>> gmail account via the local server on my machine, just to test if this
>> script works.
>>
>> I installed postfix because I read in several places that people have
>> had good luck with that mail program. From what I can tell, postfix is
>> working. I can do:
>>
>> telnet localhost 25
>> Trying 127.0.0.1...
>> Connected to localhost.
>> Escape character is '^]'.
>> 220 homemade ESMTP Postfix (Ubuntu)
>> ehlo localhost
>> 250-homemade
>> 250-PIPELINING
>> 250-SIZE 1024
>> 250-VRFY
>> 250-ETRN
>> 250-STARTTLS
>> 250-ENHANCEDSTATUSCODES
>> 250-8BITMIME
>> 250 DSN
>>
>> After the php script runs, I type 'mailq' and get the result 'mail
>> queue is empty.' If I check /var/log/mail.log, this is what I see:
>>
>> Oct 21 23:54:35 homemade postfix/pickup[5735]: 2A31EA70109: uid=33
>> from=
>> Oct 21 23:54:35 homemade postfix/cleanup[7997]: 2A31EA70109:
>> message-id=<20091022065435.2a31ea70...@homemade>
>> Oct 21 23:54:35 homemade postfix/qmgr[5736]: 2A31EA70109:
>> from=, size=499, nrcpt=1 (queue active)
>> Oct 21 23:54:35 homemade postfix/error[7999]: 2A31EA70109:
>> to=, relay=none, delay=0.04, delays=0.03/0/0/0.01,
>> dsn=5.0.0, status=bounced (gmail.com)
>> Oct 21 23:54:35 homemade postfix/cleanup[7997]: 3217DA7010A:
>> message-id=<20091022065435.3217da70...@homemade>
>> Oct 21 23:54:35 homemade postfix/qmgr[5736]: 3217DA7010A: from=<>,
>> size=2095, nrcpt=1 (queue active)
>> Oct 21 23:54:35 homemade postfix/bounce[8000]: 2A31EA70109: sender
>> non-delivery notification: 3217DA7010A
>> Oct 21 23:54:35 homemade postfix/qmgr[5736]: 2A31EA70109: removed
>> Oct 21 23:54:35 homemade postfix/local[8001]: 3217DA7010A:
>> to=, relay=local, delay=0.03, delays=0/0.02/0/0.01,
>> dsn=2.0.0, status=sent (delivered to command: procmail -a
>> "$EXTENSION")
>> Oct 21 23:54:35 homemade postfix/qmgr[5736]: 3217DA7010A: removed
>>
>> Any ideas? I am new both to php and postfix. Thanks for any help.
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php mail() function

2009-10-22 Thread LinuxManMikeC
The problem is you won't be trusted to deliver mail directly to most
mail servers unless you have a static IP.  Even then thats no
guarantee.  What you have to do is relay through your ISP's SMTP
server where you're "trusted".  You should also be able to setup PHP
to use your ISP's SMTP server and never touch the SMTP service on your
local machine (if you don't feel like playing with Postfix).

On Thu, Oct 22, 2009 at 3:56 PM, James Prentice  wrote:
> I'm trying to use the php mail() function to send a mail within a php
> script. This is using PHP 5.2.4 and Ubuntu Hardy Heron linux. The
> script runs fine and the return value of the mail function is TRUE,
> but the mail is never received. I'm trying to send an email to my
> gmail account via the local server on my machine, just to test if this
> script works.
>
> I installed postfix because I read in several places that people have
> had good luck with that mail program. From what I can tell, postfix is
> working. I can do:
>
> telnet localhost 25
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is '^]'.
> 220 homemade ESMTP Postfix (Ubuntu)
> ehlo localhost
> 250-homemade
> 250-PIPELINING
> 250-SIZE 1024
> 250-VRFY
> 250-ETRN
> 250-STARTTLS
> 250-ENHANCEDSTATUSCODES
> 250-8BITMIME
> 250 DSN
>
> After the php script runs, I type 'mailq' and get the result 'mail
> queue is empty.' If I check /var/log/mail.log, this is what I see:
>
> Oct 21 23:54:35 homemade postfix/pickup[5735]: 2A31EA70109: uid=33
> from=
> Oct 21 23:54:35 homemade postfix/cleanup[7997]: 2A31EA70109:
> message-id=<20091022065435.2a31ea70...@homemade>
> Oct 21 23:54:35 homemade postfix/qmgr[5736]: 2A31EA70109:
> from=, size=499, nrcpt=1 (queue active)
> Oct 21 23:54:35 homemade postfix/error[7999]: 2A31EA70109:
> to=, relay=none, delay=0.04, delays=0.03/0/0/0.01,
> dsn=5.0.0, status=bounced (gmail.com)
> Oct 21 23:54:35 homemade postfix/cleanup[7997]: 3217DA7010A:
> message-id=<20091022065435.3217da70...@homemade>
> Oct 21 23:54:35 homemade postfix/qmgr[5736]: 3217DA7010A: from=<>,
> size=2095, nrcpt=1 (queue active)
> Oct 21 23:54:35 homemade postfix/bounce[8000]: 2A31EA70109: sender
> non-delivery notification: 3217DA7010A
> Oct 21 23:54:35 homemade postfix/qmgr[5736]: 2A31EA70109: removed
> Oct 21 23:54:35 homemade postfix/local[8001]: 3217DA7010A:
> to=, relay=local, delay=0.03, delays=0/0.02/0/0.01,
> dsn=2.0.0, status=sent (delivered to command: procmail -a
> "$EXTENSION")
> Oct 21 23:54:35 homemade postfix/qmgr[5736]: 3217DA7010A: removed
>
> Any ideas? I am new both to php and postfix. Thanks for any help.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] PHP Mail Function

2009-06-21 Thread Ashley Sheridan
On Sat, 2009-06-20 at 20:30 -0600, David Swenson wrote:
> Julian,
> 
> From my understanding of PHP's mail() function, it doesn't do anything
> more than send to the address you specified.
> 
> On that note, I'd check things like:
> Email address typos
> The email your sending to your domain, is it already being forwarded?
> If so, do you get the email at your gmail account?
> If it's not being forwarded, add $additionalheaders to your script and
> CC: your gmail account when sending to your domain.  See if it shows up
> there.
> 
> Anyway those are somethings you could try as you have supplied no code
> to check syntax and/or given any other testing you've tried.
> 
> Good Luck,
> David
> 
> 
> -Original Message-
> From: Julian Muscat Doublesin [mailto:opensourc...@gmail.com] 
> Sent: Saturday, June 20, 2009 1:59 PM
> To: php-general@lists.php.net
> Subject: [PHP] PHP Mail Function
> 
> 
> Hello Everyone,
> 
> I have written an e-mail function that sends e-mail to my domain that
> forwards it to a gmail account.
> 
> When I use the gmail address directly it works fine. When I use my mail
> domain i don't get anything.
> 
> Has anyone experienced this? Can anyone give me some advice?
> 
> Thanks in advance
> 
> Julian
> No virus found in this incoming message.
> Checked by AVG - www.avg.com 
> Version: 8.5.364 / Virus Database: 270.12.81/2189 - Release Date:
> 06/20/09 06:15:00
> 
> 
> 
I had this problem before, and it seems that spam filters of all
descriptions were the culprit.

Thanks
Ash
www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] PHP Mail Function

2009-06-20 Thread David Swenson
Julian,

>From my understanding of PHP's mail() function, it doesn't do anything
more than send to the address you specified.

On that note, I'd check things like:
Email address typos
The email your sending to your domain, is it already being forwarded?
If so, do you get the email at your gmail account?
If it's not being forwarded, add $additionalheaders to your script and
CC: your gmail account when sending to your domain.  See if it shows up
there.

Anyway those are somethings you could try as you have supplied no code
to check syntax and/or given any other testing you've tried.

Good Luck,
David


-Original Message-
From: Julian Muscat Doublesin [mailto:opensourc...@gmail.com] 
Sent: Saturday, June 20, 2009 1:59 PM
To: php-general@lists.php.net
Subject: [PHP] PHP Mail Function


Hello Everyone,

I have written an e-mail function that sends e-mail to my domain that
forwards it to a gmail account.

When I use the gmail address directly it works fine. When I use my mail
domain i don't get anything.

Has anyone experienced this? Can anyone give me some advice?

Thanks in advance

Julian
No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.5.364 / Virus Database: 270.12.81/2189 - Release Date:
06/20/09 06:15:00



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php mail function vs smtp server

2005-10-31 Thread Richard Lynch
On Mon, October 31, 2005 5:22 am, Paul Waring wrote:
> On Mon, Oct 31, 2005 at 12:56:01PM +0200, Clive wrote:
>> Thanks I actually want to send 24 000 emails with 2 meg attachments.

Woof.

mail() is DEFINITELY the wrong answer!

Firing up an SMTP connection and spewing 24,000 emails with 2 meg
attachments at it is *ALSO* a wrong answer, almost for sure.

You will probably have a very unhappy SysAdmin behind that SMTP
server, and odds are really really really good they'll have a long
line of VERY unhappy SysAdmins behind them.

You can pretty much count on being labeled (hopefully mis-labeled) as
a spammer almost immediately.

2 meg attachments are your first biggest problem.  Lose them.  Include
a link to whatever it is for the user to download the 2 meg at their
leisure.  This is non-negotiable.  You WILL regret the 2 meg
attachment long before the 24,000th user gets it.

Queue up the emails and send them out over a controlled time.

If there's ANY question that somebody might not want this email, don't
send it.  Get them to opt-in first, if you haven't already.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php mail function vs smtp server

2005-10-31 Thread Richard Lynch
On Mon, October 31, 2005 4:10 am, Clive wrote:
> does anyone know whats better/uses less resource etc:
>
> If I run a loop to send a 1000 emails, should I use php's mail
> fucntions
> or send directly to the servers smtp server.

SMTP

PHP's mail() function was never designed for high-volume email.

It fires up a different process of sendmail for EACH email.

This is NOT cheap, nor efficient.

mail() is convenient.  It is not efficient.

Use mail() for quickie one-off emails.

Use something else for mass email.

There are classes/packages you can use to make this painless.
http://phpclasses.org has at least one that gets used/recommended a lot.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php mail function vs smtp server

2005-10-31 Thread Paul Waring
On Mon, Oct 31, 2005 at 12:56:01PM +0200, Clive wrote:
> Thanks I actually want to send 24 000 emails with 2 meg attachments.

Oh. You definitely don't want to be using an external SMTP server if you
can help it then, and you should really be splitting those up into
chunks (no more than 1,000 at a time really) using something like PEAR
Queue as has already been suggested.

> There also another option with the class: using the sendmail program, 
> but  won't the php mail function use sendmail anyway

As far as I know, mail() just sends stuff to whatever the sendmail
binary is on your system, although I haven't really looked into it. Of
course you don't have to be running sendmail as most MTA will install
binaries such as /usr/sbin/sendmail which actually point to postfix or
qmail or whatever you're running.

Paul

-- 
Rogue Tory
http://www.roguetory.org.uk

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php mail function vs smtp server

2005-10-31 Thread Marcus Bointon

On 31 Oct 2005, at 10:34, Richard Heyes wrote:

Depends on your setup. If you're on Linux/Unix you could use the  
mail() function along with the "-odq" option to Sendmail/Postfix/ 
Exim etc (fifth argument to the mail() function) which will dump  
all the mails into the MTAs queue. After this, the MTA will handle  
delivery. This is probably the quickest for this platform.


I agree. Sending directly is usually reserved for Windows machines  
with no local MTA and is usually way slower and doesn't handle  
queuing. I'd advise anyone to use PHPMailer for mail anyway as it  
makes it much more reliable to deal with all the other stuff like  
MIME encoding, plus it has support for all these sending methods  
without having to change much code. I use it with qmail.


Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php mail function vs smtp server

2005-10-31 Thread Paul Waring
On Mon, Oct 31, 2005 at 12:38:09PM +0200, Clive wrote:
> what I mean is: im using a class called phpmailer and it has the option 
> to sent to a smtp server, I suppose this means that they do open a 
> socket to the smtp server.

All that means is that you can specify an external SMTP server (e.g.
mail.myisp.com), whereas mail() will use localhost instead. In this case
mail() would probably be quite a bit faster (though only if you're
sending thousands and thousands of emails) because it won't have to send
stuff out beyond the local machine.

Depending on what you want to do and how much control you have over the
machine your PHP scripts are running on, you might want to run a local
mail server that just relays everything to an external source (whatever
SMTP server you're currently using) - that way you can send everything
to that and your PHP script should return control a bit faster.

Paul

-- 
Rogue Tory
http://www.roguetory.org.uk

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php mail function vs smtp server

2005-10-31 Thread Richard Heyes

Clive wrote:

Hi

does anyone know whats better/uses less resource etc:

If I run a loop to send a 1000 emails, should I use php's mail fucntions 
or send directly to the servers smtp server.


Depends on your setup. If you're on Linux/Unix you could use the mail() 
function along with the "-odq" option to Sendmail/Postfix/Exim etc 
(fifth argument to the mail() function) which will dump all the mails 
into the MTAs queue. After this, the MTA will handle delivery. This is 
probably the quickest for this platform.


--
Richard Heyes
http://www.phpguru.org

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php mail function vs smtp server

2005-10-31 Thread Richard Davey
Hi Clive,

Monday, October 31, 2005, 10:10:02 AM, you wrote:

> does anyone know whats better/uses less resource etc:

> If I run a loop to send a 1000 emails, should I use php's mail fucntions
> or send directly to the servers smtp server.

Use PEAR Mail Queue.

Cheers,

Rich
-- 
Zend Certified Engineer
http://www.launchcode.co.uk

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php mail function vs smtp server

2005-10-31 Thread Paul Waring
On Mon, Oct 31, 2005 at 12:10:02PM +0200, Clive wrote:
> does anyone know whats better/uses less resource etc:
> 
> If I run a loop to send a 1000 emails, should I use php's mail fucntions 
> or send directly to the servers smtp server.

What do you mean by "send directly"? Are you thinking of sending mail
manually through making a socket connection or something?

Paul

-- 
Rogue Tory
http://www.roguetory.org.uk

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP - mail() function problem

2002-08-17 Thread N. Pari Purna Chand

Hi Jason,

I have found out the mistake I did,
the /usr/bin/sendmail that my MTA(XMAIL in this case)
 uses was not 'chmod +s' ed.

Ans that is the reason when I ran the script in shell ( being logged in as
root)
it worked fine, and not thru apache.

/chandu


- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 17, 2002 11:49 PM
Subject: Re: [PHP] PHP - mail() function problem


> On Saturday 17 August 2002 21:08, N. Pari Purna Chand wrote:
> > Hi guys,
> >
> > I am facing a strange problem,
> > php's mail() function is not working when a php page is executed thru
> > apache,
> > but the same page which has mail() function is working fine and is
sending
> > mails
> > when php is used as a scripting language in shell.
>
> Is this on the same machine? If so, check that both the apache-php and the
> cgi-php are using the same php.ini (and hence same sendmail settings).
>
> > Any guess what might be causing the problem ?
>
> Try comparing php.ini.
>
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Heard that the next Space Shuttle is supposed to carry several Guernsey
cows?
> It's gonna be the herd shot 'round the world.
> */
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP - mail() function problem

2002-08-17 Thread N. Pari Purna Chand

Hi Jason,

I have found out the mistake I did,
the /usr/bin/sendmail that my MTA(XMAIL in this case)
 uses was not 'chmod +s' ed.

Ans that is the reason when I ran the script in shell ( being logged in as
root)
it worked fine, and not thru apache.

/chandu


- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 17, 2002 11:49 PM
Subject: Re: [PHP] PHP - mail() function problem


> On Saturday 17 August 2002 21:08, N. Pari Purna Chand wrote:
> > Hi guys,
> >
> > I am facing a strange problem,
> > php's mail() function is not working when a php page is executed thru
> > apache,
> > but the same page which has mail() function is working fine and is
sending
> > mails
> > when php is used as a scripting language in shell.
>
> Is this on the same machine? If so, check that both the apache-php and the
> cgi-php are using the same php.ini (and hence same sendmail settings).
>
> > Any guess what might be causing the problem ?
>
> Try comparing php.ini.
>
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Heard that the next Space Shuttle is supposed to carry several Guernsey
cows?
> It's gonna be the herd shot 'round the world.
> */
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP - mail() function problem

2002-08-17 Thread Jason Wong

On Saturday 17 August 2002 21:08, N. Pari Purna Chand wrote:
> Hi guys,
>
> I am facing a strange problem,
> php's mail() function is not working when a php page is executed thru
> apache,
> but the same page which has mail() function is working fine and is sending
> mails
> when php is used as a scripting language in shell.

Is this on the same machine? If so, check that both the apache-php and the 
cgi-php are using the same php.ini (and hence same sendmail settings).

> Any guess what might be causing the problem ?

Try comparing php.ini.


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Heard that the next Space Shuttle is supposed to carry several Guernsey cows?
It's gonna be the herd shot 'round the world.
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP MAIL function...why wont it work????

2002-03-07 Thread DL Neil

Brad,
[I've put this back on the list, because someone who's into PHP's MAIL()
from Linux might be able to help]

> OK, I 'KISS'ed' it. The line now reads:
>  mail("[EMAIL PROTECTED]", "Please call if this works", "Hi
there",
> "From: [EMAIL PROTECTED]");
> and works fine. BUT, if i put my email address
([EMAIL PROTECTED])
> in the 'to' field, no email is delivered. If i send it to any
optushome
> address, no result. Seems it will work fine if sent outside my ISP.
> Any ideas??

Well the most ?sensible is that your fine Australian carrier, being ever
mindful and caring of their customers, don't want you to talk to
yourself - or to hear those voices in your head!? Now if you told me
that you could 'talk' to in-house addresses but not 'outside', I'd not
be surprised, but this way around?

First off: you've achieved a successful transmission, so that you have
proven the connection between PHP and the SMTP mail server!

Secondly (I assume) you can use your email client to send msgs to
yourself?
(try not to listen to those voices - but don't ask me why - I'm only
repeating what people say to me, regularly!)

Ask "CK" to analyse the headers of the 'successful' msg. Take a look and
see if you can follow the various servers that the msg routed through.
Compare that with the headers on your me-to-me email and look for
commonlity/differences.

Other than that, another course would be to ask your ISP to explain the
situation/email set up/if there is some 'bar' to prevent you from
sending to yourself (a bit dopey, but possible) -  I copy every
newsletter sent to clients with one sent to 'me' - one of several checks
for success/failure).

Meantime, set yourself up with a free email service, eg Yahoo, and
organise that as a 'reflector', ie to forward any msgs received
automatically and immediately to your Optus account. Then use that for
testing your transmissions (and not having to bother CK=Superman - wish
my alter ego had such dramatic presence, but I think mine is a hat...).
That way you could get on with things meantime.

Regards,
=dn



> >> Yep it is a linux box.
> >
> > Ok, seeing that's 'sweet', go for "KISS"!
> > See earlier comments about simplifying and once 'plain vanilla' is
> > working, add back the optional headers/multiple lines, etc. Will be
> > easier to work out what's breaking things, and then address that
issue.
> >
> > Regards,
> > =dn
> >
> >
>  Hi all... I have a line in a page that should send me an email
when
> >>> the page
>  is loaded.
>  mail("[EMAIL PROTECTED]", "worked", "Line 1\nLine
2\nLine
> >>> 3");
>  when i load the page...i get NO error msgs, but the function does
> > not
> >>> send
>  the mail. There is no record of any activity in the mail
log...any
> >>> ideas...
> >>>
> >>> If your server is not a *nix box you need to separate headers with
> > CRLF
> >>> (Win) or CR (Mac).
> >>> What does php.ini say in the mail section?
> >>> Simplify the msg right down to the barest minimum, get it to work,
> > then
> >>> start adding...
> >
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP MAIL function...why wont it work????

2002-03-01 Thread DL Neil

Brad,

> Yep it is a linux box.

Ok, seeing that's 'sweet', go for "KISS"!
See earlier comments about simplifying and once 'plain vanilla' is
working, add back the optional headers/multiple lines, etc. Will be
easier to work out what's breaking things, and then address that issue.

Regards,
=dn


> >> Hi all... I have a line in a page that should send me an email when
> > the page
> >> is loaded.
> >> mail("[EMAIL PROTECTED]", "worked", "Line 1\nLine 2\nLine
> > 3");
> >> when i load the page...i get NO error msgs, but the function does
not
> > send
> >> the mail. There is no record of any activity in the mail log...any
> > ideas...
> >
> > If your server is not a *nix box you need to separate headers with
CRLF
> > (Win) or CR (Mac).
> > What does php.ini say in the mail section?
> > Simplify the msg right down to the barest minimum, get it to work,
then
> > start adding...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP MAIL function...why wont it work????

2002-02-28 Thread Brad Wright

Yep it is a linux box.

> From: "DL Neil" <[EMAIL PROTECTED]>
> Reply-To: "DL Neil" <[EMAIL PROTECTED]>
> Date: Thu, 28 Feb 2002 22:55:59 -
> To: "Brad Wright" <[EMAIL PROTECTED]>, "PHP General List"
> <[EMAIL PROTECTED]>
> Subject: Re: [PHP] PHP MAIL function...why wont it work
> 
> Hi Brad,
> 
>> Hi all... I have a line in a page that should send me an email when
> the page
>> is loaded.
>> mail("[EMAIL PROTECTED]", "worked", "Line 1\nLine 2\nLine
> 3");
>> when i load the page...i get NO error msgs, but the function does not
> send
>> the mail. There is no record of any activity in the mail log...any
> ideas...
> 
> 
> If your server is not a *nix box you need to separate headers with CRLF
> (Win) or CR (Mac).
> What does php.ini say in the mail section?
> Simplify the msg right down to the barest minimum, get it to work, then
> start adding...
> =dn
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP MAIL function...why wont it work????

2002-02-28 Thread DL Neil

Hi Brad,

> Hi all... I have a line in a page that should send me an email when
the page
> is loaded.
>  mail("[EMAIL PROTECTED]", "worked", "Line 1\nLine 2\nLine
3");
> when i load the page...i get NO error msgs, but the function does not
send
> the mail. There is no record of any activity in the mail log...any
ideas...


If your server is not a *nix box you need to separate headers with CRLF
(Win) or CR (Mac).
What does php.ini say in the mail section?
Simplify the msg right down to the barest minimum, get it to work, then
start adding...
=dn


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP mail() function. Help please...

2001-11-18 Thread Anthony Ritter

Thank you!

It works fine.

Regards,
Tony




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP mail() function. Help please...

2001-11-18 Thread Avdija A . Ahmedhodžić

do you have sendmail or smtp configured properly. Yao should test that
first. Try to put instad of SMTP=localhost name of  some other server, taht
you can connect and send mail from.


- Original Message -
From: Anthony Ritter <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: 19. studeni 2001 01:07
Subject: [PHP] PHP mail() function. Help please...


> I'm reading J.Meloni's tutorial on page 119 in "Fast and Easy" and she is
> explaining using the PHP mail function.
>
> There are two scripts for this example...
>
> One is the .html file which lays out the form with input boxes, a textarea
> box and a submit button.
>
> It is:
>
> 
> 
>  Simple Feedback Form 
> 
> 
> 
>   Your name:  
> 
>   Your e-mail address:  
> 
>   Your message:  
> 
>   
> 
> 
> 
> 
>
> The next is the PHP script which reads as follows:
>
>  $msg="This e-mail is being sent from www site\n";
> $msg.="Sender's name: \t$sender_name\n";
> $msg.="Sender's e-mail:\t$sender_email\n";
> $msg.="Message:\t$message\n\n";
> $to="[EMAIL PROTECTED]";
> $subject="Website Feedback";
> $mailheaders="From: My website<> \n";
> $mailheaders.="Reply to: $sender_email\n\n";
> mail($to,$subject,$msg,$mailheaders);
> ?>
> 
> 
> Simple Feedback Form
> 
> 
> The following e-mail has been sent:
> Your Name:
> 
> Your email address:
> 
> Message:
> 
> 
> 
> ..
>
> Everytime I input a name, e-mail, and test blurb for the message box form
> and hit submit, I get:
>
> Warning: Failed to connect in C:\Program Files\Apache
> Group\Apache\htdocs\send_simpleform.php
> in line 10.
>
> I have made the corrections in my php.ini file in the [mail function]
> to read as follows:
>
> SMTP=localhost
> [EMAIL PROTECTED]
>
> Please advise if anyone knows what I am doing wrong.
>
> Thanking all in advance.
> Tony Ritter
>
>
>
>
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP mail() function

2001-07-27 Thread Mark Maggelet

On Fri, 27 Jul 2001 13:32:49 -0600, Kevin Leavell ([EMAIL PROTECTED])
wrote:
>Regular email flows in and out just fine.
>
>The host providers are and have been fiddling with the dns stuff to
>no avail.

we don't know anything about your setup, it could be that a different
server is handling your mail. If you can ping, say, google.com from
the server then that says your dns is ok, if so your problem is
probably that php can't find sendmail or something like that.
otherwise it's a network problem and you'll have to let the host
figure it out.

>Kevin
>
>- Original Message -
>From: Mark Maggelet <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
>Sent: Friday, July 27, 2001 12:14 PM
>Subject: Re: [PHP] PHP mail() function
>
>
>On Fri, 27 Jul 2001 11:11:57 -0600, Kevin Leavell ([EMAIL PROTECTED])
>wrote:
>>mail0 is sending mail that can't be received by aol or my local
isp.
>> That
>>same mail can be received by other sites on that same server.  The
>>mail doesn't bounce but I am getting a few DSN errors in my
maillog.
>
>it sounds like you don't have dns set up. try pinging a bunch of
>domains from the server.
>
>>My site is
>>hosted at a major hosting company.  Funny enough, when the scripts
>>were run
>>on their server w/ php as a cgi, all worked well.  When I moved my
>>scripts
>>to a server that had mod_php, I began having problems.
>>
>>Any wizards out their have any ideas?  The hosting company seems to
>>have run
>>out of ideas.
>>
>>The PHP version is 4.0.3pl1 running on Redhat 6x with Apache 1.3.14
>>
>>I have tried various header configs, double checked my php.ini file
>>sendmail
>>config, but after a week of dealing with this, I'll try
>>anythingI'll
>>even dance a jig if that is what it takes.
>>
>>TIA,
>>
>>Kevin
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>To contact the list administrators, e-mail: php-list-
>>[EMAIL PROTECTED]
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: php-list-
>[EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP mail() function

2001-07-27 Thread Kevin Leavell

Regular email flows in and out just fine.

The host providers are and have been fiddling with the dns stuff to no
avail.

Kevin

- Original Message -
From: Mark Maggelet <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, July 27, 2001 12:14 PM
Subject: Re: [PHP] PHP mail() function


On Fri, 27 Jul 2001 11:11:57 -0600, Kevin Leavell ([EMAIL PROTECTED])
wrote:
>mail0 is sending mail that can't be received by aol or my local isp.
> That
>same mail can be received by other sites on that same server.  The
>mail doesn't bounce but I am getting a few DSN errors in my maillog.

it sounds like you don't have dns set up. try pinging a bunch of
domains from the server.

>My site is
>hosted at a major hosting company.  Funny enough, when the scripts
>were run
>on their server w/ php as a cgi, all worked well.  When I moved my
>scripts
>to a server that had mod_php, I began having problems.
>
>Any wizards out their have any ideas?  The hosting company seems to
>have run
>out of ideas.
>
>The PHP version is 4.0.3pl1 running on Redhat 6x with Apache 1.3.14
>
>I have tried various header configs, double checked my php.ini file
>sendmail
>config, but after a week of dealing with this, I'll try
>anythingI'll
>even dance a jig if that is what it takes.
>
>TIA,
>
>Kevin
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: php-list-
>[EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP mail() function

2001-07-27 Thread Mark Maggelet

On Fri, 27 Jul 2001 11:11:57 -0600, Kevin Leavell ([EMAIL PROTECTED])
wrote:
>mail0 is sending mail that can't be received by aol or my local isp.
> That
>same mail can be received by other sites on that same server.  The
>mail doesn't bounce but I am getting a few DSN errors in my maillog.

it sounds like you don't have dns set up. try pinging a bunch of
domains from the server.

>My site is
>hosted at a major hosting company.  Funny enough, when the scripts
>were run
>on their server w/ php as a cgi, all worked well.  When I moved my
>scripts
>to a server that had mod_php, I began having problems.
>
>Any wizards out their have any ideas?  The hosting company seems to
>have run
>out of ideas.
>
>The PHP version is 4.0.3pl1 running on Redhat 6x with Apache 1.3.14
>
>I have tried various header configs, double checked my php.ini file
>sendmail
>config, but after a week of dealing with this, I'll try
>anythingI'll
>even dance a jig if that is what it takes.
>
>TIA,
>
>Kevin
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: php-list-
>[EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]