localhost SMTP server? HowDoI?

Post non-phpwcms related topics here - but I don't want to see "hey check this or that other cms". Post if you have a point or worthwhile comment, don't post just to increase you post count!
Post Reply
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

localhost SMTP server? HowDoI?

Post by pSouper »

hi guys,
Can anyone help me with my smtp server please?

I have no idea how to set up an smtp server on my localhost server, I am totally without clue so any help (and all is most apreciated) should be aimed at a moron ;)

what do i need other than my setup as described below?

my aim is to me able to use the mail services in phpwcms.

thanks in advance.
User avatar
isac
Posts: 410
Joined: Tue 18. Nov 2003, 13:13
Location: Portugal
Contact:

Post by isac »

SMTP

If we want that our pages PHP send electronic mails, using the function mail() for systems of recommendations, contact or other applications of send mail, we can install a smtp server. With these servers we will be able to send post office from PHP, but we will not be able to receive since they are SMTP server (Send) and not Pop/imap (incoming).

Configuration of the file php.ini

We are going to open with our text editor the file php.ini located in C:\php \,(or other location C:\windows if it is already instaled) this one comes by defect formed for a server mail installed in localhost, but sendmail_from can be changed to him to the variable, that is in charge to put the sender who will appear to him to the person who receives the mail if we did not specify it in the heads, in field FROM, of the function mail() of our pages PHP.

We looked for the lines:

[mail function]
; For Win32 only.
SMTP = localhost

; For Win32 only.
sendmail_from = me@localhost.com


We can change sendmail_from placing the sender that you want, for example: user@myadress.com

Of such form that is:

[mail function]
; For Win32 only.
SMTP = localhost

; For Win32 only.
sendmail_from = user@myadress.com


We closed, and kept the changes and we copied the file, php.ini, to C:\WINDOWS\

Installation of a smtp mail server

A good smtp server would be QK smtp Server we found it in http://www.qksoft.com /, click in Download now and to begin the installation. It is not necessary to modify nothing in this program, it is only necessary to have it open and the Apache running and we can send post office by means of PHP.

Testing smtp server

We opened the Notepad and we wrote:

<?php
$sfrom="sender@mail.com"; //Sender
$sdestination="destination@mail.com"; //Destination
$ssubject="Test SMTP"; //Subject
$shtml="smtp works correctly."; //Mensaje
$sheader="From:".$sfrom."\nReply-To:".$sfrom."\n";
$sheader=$sheader."X-Mailer:PHP/".phpversion()."\n";
$sheader=$sheader."Mime-Version: 1.0\n";
$sheader=$sheader."Content-Type: text/html";
mail($sdestination,$ssubject,$shtml,$sheader);
?>


You change sender@mail.com that will be the one that appears like sender of the mail and destination@mail.com that will be the mail mailbox where east Test smtp arrived.

We save the file as TestSMTP.php and place in your root folder (htdocs or www)

With start apache and QK smtp Server .

In the bar of directions of the navigator you write: http://localhost/TestSMTP.php or http://127.0.0.1/TestSMTP.php nothing else to enter this page executes script and send the mail. Later go to the mailbox which you put in #$$sdestination>, to see if arrived the mail successfully. If you reload the page the mail is sent again.

"as you can see my English is very poor :oops: , but You must understand something"
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

isac wrote: "as you can see my English is very poor :oops: , but You must understand something"
In this forum nobody have to be sorry - we all try to do our best....
http://www.studmed.dk Portal for doctors and medical students in Denmark
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post by pSouper »

THANK YOU SO MUCH ISAC :lol:

3.5 mins 'door to door' and that includes the download install and tes.php :)

one more thing though - as I use IIS could i use this instead of the download? if so how?

thanks again.


frold is right noone has to be sorry here [truth is any one who spends a longer at thier computer than us just IS a sorry dude ]
User avatar
isac
Posts: 410
Joined: Tue 18. Nov 2003, 13:13
Location: Portugal
Contact:

Post by isac »

pSouper wrote: as I use IIS could i use this instead of the download? if so how?
I dont know! but if you follow this http://mailenable.com/, maybe you find the right tool for your needs. :wink:
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post by pSouper »

Thanks for the link isac it is just the thing SMTP & POP for free ;)
User avatar
isac
Posts: 410
Joined: Tue 18. Nov 2003, 13:13
Location: Portugal
Contact:

Post by isac »

Post Reply