Setting up Apache2 (Test Server on localhost) for email

Hi all,

I am designing a PHP5, MySQL website. I am developing on my local machine,
Windows XP and Apache 2. How do I test sending emails PHP mail() function.

Do I need to set up Apache to run CGI. If so, how. Please.

Thank you in advance,
Clinton
natalie vacca [ Mo, 03 April 2006 01:40 ] [ ID #1258331 ]

Re: Setting up Apache2 (Test Server on localhost) for email

natalie vacca wrote:
> Hi all,
>
> I am designing a PHP5, MySQL website. I am developing on my local machine,
> Windows XP and Apache 2. How do I test sending emails PHP mail() function.

You need to install a mailserver and modify your php.ini to support the
installed mailserver.


> Do I need to set up Apache to run CGI. If so, how. Please.

Depending on what kind of php you write, it can be a good idea to really test
it in a real environment.


//Aho
Shion [ Mo, 03 April 2006 06:01 ] [ ID #1258332 ]

Re: Setting up Apache2 (Test Server on localhost) for email

Thanks J.O.,


I will test it in the real enviroment, but would like to test it with other
code on my test server.

To me this is right:

....
$txtHeaders = 'From: me [at] myplace.com' . "\r\n" .
'Reply-To: me [at] myplace.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();


mail($txtTo, $txtSubject, $txtMessage, $txtHeaders);

All other variables are defined to. Do I need to log in to the sending
account somehow?

Thanks anyone who can help.
NV

"J.O. Aho" <user [at] example.net> wrote in message
news:49bl00FnujuhU3 [at] individual.net...
> natalie vacca wrote:
>> Hi all,
>>
>> I am designing a PHP5, MySQL website. I am developing on my local
>> machine, Windows XP and Apache 2. How do I test sending emails PHP mail()
>> function.
>
> You need to install a mailserver and modify your php.ini to support the
> installed mailserver.
>
>
>> Do I need to set up Apache to run CGI. If so, how. Please.
>
> Depending on what kind of php you write, it can be a good idea to really
> test it in a real environment.
>
>
> //Aho
natalie vacca [ Mo, 03 April 2006 10:54 ] [ ID #1258335 ]

Re: Setting up Apache2 (Test Server on localhost) for email

I highly recommend that you look at PHPMailer. It is a mailing class
that takes many of the details out of the way, leaving you with a nice
set of functions that make mailing easy. There is also a mailing list
and archives that are filled with answers to common problems. It
supports both embedded images and attachments. You can find details at

http://phpmailer.sourceforge.net/

and an excellent tutorial at

http://www.phpfreaks.com/tutorials/130/0.php
Roger Dodger [ Mo, 03 April 2006 15:39 ] [ ID #1258338 ]

Re: Setting up Apache2 (Test Server on localhost) for email

natalie vacca wrote:

> To me this is right:
>
> ...
> $txtHeaders = 'From: me [at] myplace.com' . "\r\n" .
> 'Reply-To: me [at] myplace.com' . "\r\n" .
> 'X-Mailer: PHP/' . phpversion();
>
>
> mail($txtTo, $txtSubject, $txtMessage, $txtHeaders);
>
> All other variables are defined to. Do I need to log in to the sending
> account somehow?

It's nothing with your php-code to do, you need to configure your php-engine
to use a mailer program/server, look in your php.ini, which most likely is
somewhere where you have got your php-engine installed.


//Aho
Shion [ Mo, 03 April 2006 17:00 ] [ ID #1258341 ]

Re: Setting up Apache2 (Test Server on localhost) for email

try postcast server.

http://www.postcastserver.com/


"J.O. Aho" <user [at] example.net> wrote in message
news:49crkuFnqpmgU3 [at] individual.net...
> natalie vacca wrote:
>
> > To me this is right:
> >
> > ...
> > $txtHeaders = 'From: me [at] myplace.com' . "\r\n" .
> > 'Reply-To: me [at] myplace.com' . "\r\n" .
> > 'X-Mailer: PHP/' . phpversion();
> >
> >
> > mail($txtTo, $txtSubject, $txtMessage, $txtHeaders);
> >
> > All other variables are defined to. Do I need to log in to the sending
> > account somehow?
>
> It's nothing with your php-code to do, you need to configure your
php-engine
> to use a mailer program/server, look in your php.ini, which most likely is
> somewhere where you have got your php-engine installed.
>
>
> //Aho
Simon Bridgewater [ Mo, 03 April 2006 19:04 ] [ ID #1258343 ]
PHP » alt.php.sql » Setting up Apache2 (Test Server on localhost) for email

Vorheriges Thema: PHPmyadmin, creating user details for a database....
Nächstes Thema: using DISTINCT with merged tables?