For Programmers: Free Programming Magazines  


Home > Archive > PHP SQL > April 2006 > Setting up Apache2 (Test Server on localhost) for email









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 Setting up Apache2 (Test Server on localhost) for email
natalie vacca

2006-04-02, 6:59 pm

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


J.O. Aho

2006-04-03, 4:00 am

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

2006-04-03, 4:00 am

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@myplace.com' . "\r\n" .
'Reply-To: me@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@example.net> wrote in message
news:49bl00FnujuhU3@individual.net...
> natalie vacca wrote:
>
> You need to install a mailserver and modify your php.ini to support the
> installed mailserver.
>
>
>
> Depending on what kind of php you write, it can be a good idea to really
> test it in a real environment.
>
>
> //Aho



Roger Dodger

2006-04-03, 7:00 pm

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

J.O. Aho

2006-04-03, 7:00 pm

natalie vacca wrote:

> To me this is right:
>
> ...
> $txtHeaders = 'From: me@myplace.com' . "\r\n" .
> 'Reply-To: me@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

2006-04-03, 7:00 pm

try postcast server.

http://www.postcastserver.com/


"J.O. Aho" <user@example.net> wrote in message
news:49crkuFnqpmgU3@individual.net...
> natalie vacca wrote:
>
>
> 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



Sponsored Links







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

Copyright 2008 codecomments.com