For Programmers: Free Programming Magazines  


Home > Archive > PHP SQL > November 2004 > Howto make a PHP script send mail? (on a Netware server)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Howto make a PHP script send mail? (on a Netware server)
Richard Salin

2004-11-02, 8:55 am

Hi
My question is the same as the title. I don't know if it differs from a
unix server, but since a windows server don't support the mail()
(to my knowledge) I asume that's it's the same with a Netware server.
- I don't need some fancy email function, just so I could send the value of
a couple of textboxes and would appreciate if there's someone who knows
how it's done.
Thanks in advance!

Richard




J.O. Aho

2004-11-02, 8:56 am

Richard Salin wrote:
> Hi
> My question is the same as the title. I don't know if it differs from a
> unix server, but since a windows server don't support the mail()
> (to my knowledge) I asume that's it's the same with a Netware server.
> - I don't need some fancy email function, just so I could send the value of
> a couple of textboxes and would appreciate if there's someone who knows


You could use an external shell command to send mail with php, in case you
can't use the mail().

exec("mail -s \"Subject\" root@youremail.net $mailbody");

This requiers the mail command.


//Aho
marcus@myrealbox.com

2004-11-02, 8:55 pm


On Tue, 2 Nov 2004 11:20:34 +0200, "Richard Salin" <NoSpam@ThankYou.com> wrote:

>My question is the same as the title. I don't know if it differs from a
>unix server, but since a windows server don't support the mail()
>(to my knowledge) I asume that's it's the same with a Netware server.


What e-mail server does the client have?

regards
Marcus

Daedalus

2004-11-02, 8:55 pm

> [...] but since a windows server don't support the mail()
> (to my knowledge) [...]


Actually the mail() function does work under windows

Dae


shawn

2004-11-03, 3:56 pm

I have the same problem. I have apache running on a PC with Windows XP and
mail() doesn't work. However, perl sends mail on my localhost. will I be
able to call a perl cgi script to send mail instead?

Shawn


"Daedalus" <arsenault.daniel@videotron.ca> wrote in message
news:8pThd.43297$t45.1654640@weber.videotron.net...
>
> Actually the mail() function does work under windows
>
> Dae
>
>



Daedalus

2004-11-03, 8:56 pm

> I have the same problem. I have apache running on a PC with Windows XP and
> mail() doesn't work. However, perl sends mail on my localhost. will I be
> able to call a perl cgi script to send mail instead?
>
> Shawn


Yeah sure.
(For an email form you could submit it to a cgi script from the html form.)
If you need the perl script to be call by the php script then the exec()
function, like J.O. Aho said...
Something like this:
exec("perl c:\path\to\the\script.pl $ARGUMENTS");

But about the PHP mail() function, under windows it's important that you set
some php.ini lines under [mail function]
SMTP = smtp.yourISP.com // This is a fake exemple of course, this must
be the SMTP server of your email provider.
smtp_port = 25 // Default port is 25.
sendmail_from = you@yourISP.com


Dae


Nikolai Chuvakhin

2004-11-04, 3:56 pm

"Richard Salin" <NoSpam@ThankYou.com> wrote in message
news:<cm7jh0$fie$1@phys-news1.kolumbus.fi>...
>
> My question is the same as the title. I don't know if it differs from a
> unix server, but since a windows server don't support the mail()
> (to my knowledge) I asume that's it's the same with a Netware server.


You can always send mail via an external SMTP server, even if the
mail() function is not supported on your system. There are plenty
of classes that allow you to do just that. My personal favorite
is phpMailer:

http://phpmailer.sf.net/

Cheers,
NC
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com