Re: [PHP] need some ideas here...

2001-05-16 Thread James Holloway

Hi Christian,

I have an account with f2s.com that I use for sampling scripts with - I set
up a mailform yesterday after reading this, using mail() to send the email
to myself.  It got here - albeit 6am today (I sent it yesterday
lunchtime)  Perhaps you're using the mail() function incorrectly?

James.

Christian Dechery [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 My free-web-hosting (www.f2s.com) does not allow PHP to send emails...
I've
 tried everything... the mail() function, my alternate function which calls
 popen(/usr/lib/sendmail -t) and even a script.cgi with '#!/usr/bin/php'
 and all that stuff...

 the mail simply won't go an mail() always returns false...
 I'm guessing there's no mail sending in this server...

 so what do I do?

 is it possible for me to call a script on another host from with a script
 and return something to it?




-- 
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] need some ideas here...

2001-05-16 Thread Christian Dechery

At 09:27 16/5/2001 +0100, James Holloway wrote:
Hi Christian,

I have an account with f2s.com that I use for sampling scripts with - I set
up a mailform yesterday after reading this, using mail() to send the email
to myself.  It got here - albeit 6am today (I sent it yesterday
lunchtime)  Perhaps you're using the mail() function incorrectly?

Well.. maybe something is wrong with my account or something cuz I'm using 
it fine... I've tried 3 different ways to send mail that works everywhere 
else I just put up this little script to send a sample mail...

$to=[EMAIL PROTECTED];
$from=MySelf [EMAIL PROTECTED];
$subject=just testing;
$body=h1Hello! Just testing here/h1;
$headers=Content-type: text/html\nFrom: .$from;

$rs=mail($to,$subject,$body,$headers);
$result=($rs)?successfull.:failed.;
echo Mail to .$to.: .$result;

guess what was the output? Mail to [EMAIL PROTECTED]: failed.

what's wrong with the script above?


-- 
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] need some ideas here...

2001-05-15 Thread Christian Dechery

At 20:32 14/5/2001 -0500, Ben Gollmer wrote:
If you have an account on a remote host, you can always do something like 
this:

?php
 include(http://www.remotehost.com/~myaccount/mailfunction.inc;);

 mymail($to, $mailbody);
?

where mailfunction.inc has the mymail function defined to just take your 
parameters and stuff them into the standard mail().

Of course include()ing from remote hosts can be disabled when compiling 
PHP, and if your host is really evil, the will have disabled this too.

Your last resort is to create your own mail function by fsockopen()ing a 
connection to port 25 of your SMTP server and sending raw SMTP commands. 
This would require some reading of the relevant mail RFCs...but is 
definitely feasible.


I tried using fopen('.') on a script hosted at a domain that belongs to 
me that sends email... trying it here (even calling the script elsewhere on 
the internet 'http://www.mydomain.com') it wordked perfect...
then I tried the fsockopen alternative... it didn't work...

f2s runs in safemode... so in their faq, they tell us that if we won't some 
more advanced scripts... to use the cgi version (script.cgi starting with 
'#!/usr/bin/php'... and so on)... nothing works... they must have a real 
protection against acessing outer files there...


-- 
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] need some ideas here...

2001-05-15 Thread Christian Dechery

At 22:40 14/5/2001 -0700, Ethan Schroeder wrote:
I don't know how you can find sendmail on that system if you don't have
telnet access.  Try writing a script that does an exec(which sendmail) and
see if it tells you.  I doubt it will, though.  Otherwise try different
sendmail locations: /usr/sbin/sendmail, /usr/lib/sendmail, etc.  The
.htacess file overwrites the value of the php.ini file, so you can specify
to php where sendmail is for any script that is under the directory your
.htaccess file resides in (unless they don't allow .htaccess).  I've had to
use this approach a couple times to get php to send mail off properly.


actually I discovered with ini_get()... I'll try now with popen() and stuff 
again... may it'll work... this is my last hope... I tried calling a script 
in another domain, I tried fsockopen... nothing seems to work...

this is my last attempt...


-- 
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] need some ideas here...

2001-05-14 Thread Christian Dechery

My free-web-hosting (www.f2s.com) does not allow PHP to send emails... I've 
tried everything... the mail() function, my alternate function which calls 
popen(/usr/lib/sendmail -t) and even a script.cgi with '#!/usr/bin/php' 
and all that stuff...

the mail simply won't go an mail() always returns false...
I'm guessing there's no mail sending in this server...

so what do I do?

is it possible for me to call a script on another host from with a script 
and return something to it?

like
?php
code ... code ... code...;
code ... code ... code...;

here I'd have some code to call a script in another host that can send 
mails, of course with the necessary parms...;

code code code;
code code code;
?

. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer


-- 
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] need some ideas here...

2001-05-14 Thread Ethan Schroeder

Find where there sendmail is and put this in an .htaccess file: php_value
sendmail_path  '/path/to/sendmail -t'

Ethan Schroeder

- Original Message -
From: Christian Dechery [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, May 14, 2001 7:04 PM
Subject: [PHP] need some ideas here...


 My free-web-hosting (www.f2s.com) does not allow PHP to send emails...
I've
 tried everything... the mail() function, my alternate function which calls
 popen(/usr/lib/sendmail -t) and even a script.cgi with '#!/usr/bin/php'
 and all that stuff...

 the mail simply won't go an mail() always returns false...
 I'm guessing there's no mail sending in this server...

 so what do I do?

 is it possible for me to call a script on another host from with a script
 and return something to it?

 like
 ?php
 code ... code ... code...;
 code ... code ... code...;

 here I'd have some code to call a script in another host that can send
 mails, of course with the necessary parms...;

 code code code;
 code code code;
 ?
 
 . Christian Dechery (lemming)
 . http://www.tanamesa.com.br
 . Gaita-L Owner / Web Developer


 --
 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] need some ideas here...

2001-05-14 Thread Chris Adams

On 14 May 2001 16:59:48 -0700, Christian Dechery [EMAIL PROTECTED] wrote:
 My free-web-hosting (www.f2s.com) does not allow PHP to send emails... I've 
 tried everything... the mail() function, my alternate function which calls 
 popen(/usr/lib/sendmail -t) and even a script.cgi with '#!/usr/bin/php' 
 and all that stuff...


Did you try a popen with something /usr/bin/mail? (I assume you've checked the
file paths to make sure they're correct)

 the mail simply won't go an mail() always returns false...
 I'm guessing there's no mail sending in this server...
 
 so what do I do?
 
 is it possible for me to call a script on another host from with a script 
 and return something to it?

PHP does allow arbitrary URLs to be loaded, so you could setup a script and
simply do something like this:

$email_script = fopen(http://someotherhost/mail/script.php?To=blah...;, r);
$Status = fgetss($email_script);

If you need to send large emails, you'll need to fake a POST request. I've had
to do this the hard way in the past but I think there are a couple PHP classes
floating around now which will let you do it. (And, of course, you could use
CURL)

Alternately, if you have a friendly mail server available, you could simply use
one of the SMTP scripts available to send directly to the mail server. Check
out phpclasses.upperdesign.com for a couple scripts.

-- 
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] need some ideas here...

2001-05-14 Thread Christian Dechery

what??? I didn't understand... how will I find out where sendmail is in a 
free-web-host? I don't have telnet access... how can I figure that out? and 
how a .htaccess file would help me here?

At 19:50 14/5/2001 -0500, Ethan Schroeder wrote:
Find where there sendmail is and put this in an .htaccess file: php_value
sendmail_path  '/path/to/sendmail -t'

Ethan Schroeder

- Original Message -
From: Christian Dechery [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, May 14, 2001 7:04 PM
Subject: [PHP] need some ideas here...


  My free-web-hosting (www.f2s.com) does not allow PHP to send emails...
I've
  tried everything... the mail() function, my alternate function which calls
  popen(/usr/lib/sendmail -t) and even a script.cgi with '#!/usr/bin/php'
  and all that stuff...
 
  the mail simply won't go an mail() always returns false...
  I'm guessing there's no mail sending in this server...
 
  so what do I do?
 
  is it possible for me to call a script on another host from with a script
  and return something to it?
 
  like
  ?php
  code ... code ... code...;
  code ... code ... code...;
 
  here I'd have some code to call a script in another host that can send
  mails, of course with the necessary parms...;
 
  code code code;
  code code code;
  ?
  
  . Christian Dechery (lemming)
  . http://www.tanamesa.com.br
  . Gaita-L Owner / Web Developer
 
 
  --
  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]
 


. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer


-- 
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] need some ideas here...

2001-05-14 Thread Ben Gollmer

If you have an account on a remote host, you can always do something 
like this:

?php
include(http://www.remotehost.com/~myaccount/mailfunction.inc;);

mymail($to, $mailbody);
?

where mailfunction.inc has the mymail function defined to just take your 
parameters and stuff them into the standard mail().

Of course include()ing from remote hosts can be disabled when compiling 
PHP, and if your host is really evil, the will have disabled this too.

Your last resort is to create your own mail function by fsockopen()ing a 
connection to port 25 of your SMTP server and sending raw SMTP commands. 
This would require some reading of the relevant mail RFCs...but is 
definitely feasible.


Ben Gollmer


On Monday, May 14, 2001, at 07:04 PM, Christian Dechery wrote:

 My free-web-hosting (www.f2s.com) does not allow PHP to send emails... 
 I've tried everything... the mail() function, my alternate function 
 which calls popen(/usr/lib/sendmail -t) and even a script.cgi with 
 '#!/usr/bin/php' and all that stuff...

 the mail simply won't go an mail() always returns false...
 I'm guessing there's no mail sending in this server...

 so what do I do?

 is it possible for me to call a script on another host from with a 
 script and return something to it?

 like
 ?php
 code ... code ... code...;
 code ... code ... code...;

 here I'd have some code to call a script in another host that can send 
 mails, of course with the necessary parms...;

 code code code;
 code code code;
 ?
 
 . Christian Dechery (lemming)
 . http://www.tanamesa.com.br
 . Gaita-L Owner / Web Developer


 -- 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] need some ideas here...

2001-05-14 Thread Ethan Schroeder

I don't know how you can find sendmail on that system if you don't have
telnet access.  Try writing a script that does an exec(which sendmail) and
see if it tells you.  I doubt it will, though.  Otherwise try different
sendmail locations: /usr/sbin/sendmail, /usr/lib/sendmail, etc.  The
.htacess file overwrites the value of the php.ini file, so you can specify
to php where sendmail is for any script that is under the directory your
.htaccess file resides in (unless they don't allow .htaccess).  I've had to
use this approach a couple times to get php to send mail off properly.

Ethan Schroeder
- Original Message -
From: Christian Dechery [EMAIL PROTECTED]
To: Ethan Schroeder [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, May 14, 2001 6:30 PM
Subject: Re: [PHP] need some ideas here...


 what??? I didn't understand... how will I find out where sendmail is in a
 free-web-host? I don't have telnet access... how can I figure that out?
and
 how a .htaccess file would help me here?

 At 19:50 14/5/2001 -0500, Ethan Schroeder wrote:
 Find where there sendmail is and put this in an .htaccess file: php_value
 sendmail_path  '/path/to/sendmail -t'
 
 Ethan Schroeder
 
 - Original Message -
 From: Christian Dechery [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, May 14, 2001 7:04 PM
 Subject: [PHP] need some ideas here...
 
 
   My free-web-hosting (www.f2s.com) does not allow PHP to send emails...
 I've
   tried everything... the mail() function, my alternate function which
calls
   popen(/usr/lib/sendmail -t) and even a script.cgi with
'#!/usr/bin/php'
   and all that stuff...
  
   the mail simply won't go an mail() always returns false...
   I'm guessing there's no mail sending in this server...
  
   so what do I do?
  
   is it possible for me to call a script on another host from with a
script
   and return something to it?
  
   like
   ?php
   code ... code ... code...;
   code ... code ... code...;
  
   here I'd have some code to call a script in another host that can send
   mails, of course with the necessary parms...;
  
   code code code;
   code code code;
   ?
   
   . Christian Dechery (lemming)
   . http://www.tanamesa.com.br
   . Gaita-L Owner / Web Developer
  
  
   --
   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]
  

 
 . Christian Dechery (lemming)
 . http://www.tanamesa.com.br
 . Gaita-L Owner / Web Developer


 --
 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] need some ideas here...

2001-05-14 Thread Chris Adams

On 14 May 2001 19:04:43 -0700, Ben Gollmer [EMAIL PROTECTED] wrote:
 If you have an account on a remote host, you can always do something 
 like this:
 
?php
   include(http://www.remotehost.com/~myaccount/mailfunction.inc;);
 
   mymail($to, $mailbody);
 ?
 
 where mailfunction.inc has the mymail function defined to just take your 
 parameters and stuff them into the standard mail().

Wouldn't this still run the code on the local server with the dysfunctional
mail() command?

-- 
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] need some ideas here...

2001-05-14 Thread Ethan Schroeder

I should correct myself.  The .htaccess file doesn't overwrite the php.ini
value, rather it overrides it.

Ethan Schroeder

- Original Message -
From: Ethan Schroeder [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; Christian Dechery [EMAIL PROTECTED]
Sent: Monday, May 14, 2001 10:40 PM
Subject: Re: [PHP] need some ideas here...


 I don't know how you can find sendmail on that system if you don't have
 telnet access.  Try writing a script that does an exec(which sendmail)
and
 see if it tells you.  I doubt it will, though.  Otherwise try different
 sendmail locations: /usr/sbin/sendmail, /usr/lib/sendmail, etc.  The
 .htacess file overwrites the value of the php.ini file, so you can specify
 to php where sendmail is for any script that is under the directory your
 .htaccess file resides in (unless they don't allow .htaccess).  I've had
to
 use this approach a couple times to get php to send mail off properly.

 Ethan Schroeder
 - Original Message -
 From: Christian Dechery [EMAIL PROTECTED]
 To: Ethan Schroeder [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Monday, May 14, 2001 6:30 PM
 Subject: Re: [PHP] need some ideas here...


  what??? I didn't understand... how will I find out where sendmail is in
a
  free-web-host? I don't have telnet access... how can I figure that out?
 and
  how a .htaccess file would help me here?
 
  At 19:50 14/5/2001 -0500, Ethan Schroeder wrote:
  Find where there sendmail is and put this in an .htaccess file:
php_value
  sendmail_path  '/path/to/sendmail -t'
  
  Ethan Schroeder
  
  - Original Message -
  From: Christian Dechery [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Monday, May 14, 2001 7:04 PM
  Subject: [PHP] need some ideas here...
  
  
My free-web-hosting (www.f2s.com) does not allow PHP to send
emails...
  I've
tried everything... the mail() function, my alternate function which
 calls
popen(/usr/lib/sendmail -t) and even a script.cgi with
 '#!/usr/bin/php'
and all that stuff...
   
the mail simply won't go an mail() always returns false...
I'm guessing there's no mail sending in this server...
   
so what do I do?
   
is it possible for me to call a script on another host from with a
 script
and return something to it?
   
like
?php
code ... code ... code...;
code ... code ... code...;
   
here I'd have some code to call a script in another host that can
send
mails, of course with the necessary parms...;
   
code code code;
code code code;
?

. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer
   
   
--
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]
   
 
  
  . Christian Dechery (lemming)
  . http://www.tanamesa.com.br
  . Gaita-L Owner / Web Developer
 
 
  --
  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]



-- 
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] need some ideas here...

2001-05-14 Thread Ben Gollmer

On Monday, May 14, 2001, at 10:00 PM, Chris Adams wrote:

 On 14 May 2001 19:04:43 -0700, Ben Gollmer [EMAIL PROTECTED] wrote:
 If you have an account on a remote host, you can always do something
 like this:

 ?php
  include(http://www.remotehost.com/~myaccount/mailfunction.inc;);

  mymail($to, $mailbody);
 ?

 where mailfunction.inc has the mymail function defined to just take 
 your
 parameters and stuff them into the standard mail().

 Wouldn't this still run the code on the local server with the 
 dysfunctional
 mail() command?

You are right - brain fart. Whomever suggested GETing or POSTing the 
mail text to a remote script earlier was correct. : )

Ben

-- 
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] need some ideas here...

2001-05-14 Thread Joe Conway

 My free-web-hosting (www.f2s.com) does not allow PHP to send emails...
I've
 tried everything... the mail() function, my alternate function which calls
 popen(/usr/lib/sendmail -t) and even a script.cgi with '#!/usr/bin/php'
 and all that stuff...

 the mail simply won't go an mail() always returns false...
 I'm guessing there's no mail sending in this server...

 so what do I do?

If you know an SMTP server that will allow you to relay mail, you can use
fsockopen and write the mail directly to the port 25 on the relay server. I
haven't tried it with PHP, but I've done something similar with tcl before.
You might try finding something like this already written.

-- Joe


-- 
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]