smtp mail and php form

Problems with the Windows version of XAMPP, questions, comments, and anything related.

smtp mail and php form

Postby swgipson » 20. January 2005 04:31

Hi!
I just installed xampp on my laptop so I can demonstrate offline to clients. I have a php form in a folder in the htdocs. If I test the form I get this error.

Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\apachefriends\xampp\htdocs\midamericatest\businessthankyou.php on line 37


My php code is working on a real hosting server online. How can I get it to work? I also turned off my firewall and still received the error.

Thanks!!!

Sharon
swgipson
 
Posts: 7
Joined: 20. January 2005 04:17

Postby taustin » 20. January 2005 17:23

Do you have a mail server running on the laptop?
taustin
 
Posts: 150
Joined: 24. September 2004 00:23
Location: Huntington Beach CA

Postby swgipson » 20. January 2005 17:48

There is Mercury mail that is included with the xampp install. Other than that no.

Sharon
swgipson
 
Posts: 7
Joined: 20. January 2005 04:17

Postby Maller » 21. January 2005 12:07

Just use the smtp server supplied by your ISP
User avatar
Maller
 
Posts: 49
Joined: 06. March 2004 14:47

Postby elkodesign » 21. January 2005 12:34

Check your php.ini file and adjust the following section to your specifications.

Code: Select all
[mail function]
; For Win32 only.
SMTP = smtp.yourprovider.com

; For Win32 only.
sendmail_from = yourname@email.com
Greetingzzz,

Elko
www.elkodesign.nl
elkodesign
 
Posts: 6
Joined: 29. September 2004 12:07
Location: Lelystad, Netherlands

Postby swgipson » 21. January 2005 15:52

Okay that worked thanks! What if I want to test though and i'm not online. Would I need to installl something?

Sharon
swgipson
 
Posts: 7
Joined: 20. January 2005 04:17

Postby taustin » 21. January 2005 17:32

You can run Mercury and set php.ini to localhost. You'll have to set up a fake domain, and at least one local user, in Mercury, and start it manually when you need it.
taustin
 
Posts: 150
Joined: 24. September 2004 00:23
Location: Huntington Beach CA

Postby swgipson » 21. January 2005 17:45

You can run Mercury and set php.ini to localhost. You'll have to set up a fake domain, and at least one local user, in Mercury, and start it manually when you need it.

How do I set up a fake domain? I figured out how to start it. It does have a test user.
swgipson
 
Posts: 7
Joined: 20. January 2005 04:17

Postby taustin » 21. January 2005 22:10

In the Configuration menu, go to Mercury Core Module, and go to the Local Domains tab. There's probably something there already, if only "localhost." Just make sure any email you send is addressed to a valid address (like the test user) in that domain, so something like testuser@localhost. Mercury should accept it at that point.
taustin
 
Posts: 150
Joined: 24. September 2004 00:23
Location: Huntington Beach CA

Postby swgipson » 22. January 2005 00:23

Okay, I changed the e-mail address in the form to postmaster@localhost I didn't get any errors and it was sent. Now to figure out how to read postmaster inbox or where it is located in Mercury?

Thanks!!!

Sharon
swgipson
 
Posts: 7
Joined: 20. January 2005 04:17

Postby taustin » 22. January 2005 01:40

You can run a normal email client, like Outlook Express. The server name would be localhost, the user name and password whatever they are for the account.

You can also look at it directly in Explorer. Mercury is installed in

c:\apachefriends\xampp\mercurymail

The email would be in

c:\apachefriends\xampp\mercurymail\mail, with each user having a directory named after their user name.

Or you could install a webmail client (since xampp is a web server), and check it that way. I would presently recommend IlohaMail from http://ilohamail.org/ Very simple to set up and get running.
taustin
 
Posts: 150
Joined: 24. September 2004 00:23
Location: Huntington Beach CA

Postby swgipson » 22. January 2005 02:26

okay, I set it up in outlook express with incoming and outgoing servers localhost. I didn't get any errors but after I sent the form it didn't pull it in.

I have this in my php.ini file

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

; For Win32 only.
sendmail_from = postmaster@localhost

is this correct?

I had changed it earlier so I can't remember what it was set to before.

Sharon
swgipson
 
Posts: 7
Joined: 20. January 2005 04:17

Postby taustin » 22. January 2005 09:27

The sendmail_from address shouldn't matter if it is going to a valid local address.

The only thing that comes to mind is check the Mercury log, or turn on session logs to see what's actually happening.
taustin
 
Posts: 150
Joined: 24. September 2004 00:23
Location: Huntington Beach CA

Postby swgipson » 22. January 2005 16:10

This is what is in the Mercury log

T 20050122 090704 41f214b3 MAIL FROM:<postmaster@localhost>
T 20050122 090704 41f214b3 RCPT TO:<postmaster@localhost>
T 20050122 090704 41f214b3 DATA - 16 lines, 350 bytes.
T 20050122 090705 41f214b3 QUIT
T 20050122 090705 41f214b3 Connection closed with 127.0.0.1, 1 sec. elapsed.


Sharon
swgipson
 
Posts: 7
Joined: 20. January 2005 04:17

Postby taustin » 04. February 2005 18:15

swgipson wrote:This is what is in the Mercury log

T 20050122 090704 41f214b3 MAIL FROM:<postmaster@localhost>
T 20050122 090704 41f214b3 RCPT TO:<postmaster@localhost>
T 20050122 090704 41f214b3 DATA - 16 lines, 350 bytes.
T 20050122 090705 41f214b3 QUIT
T 20050122 090705 41f214b3 Connection closed with 127.0.0.1, 1 sec. elapsed.


Says it was sent successfully. Look in the mercury\mail\postmaster\ folder and see if there's anything there other than the password file. Also, look in the mercury\queue folder and see if there anything at all in there. If there's a problem with delivery, that's where it will hang.

Sometimes, Mercury gets . . . confused about where account folders go. Go to the Manage Local Users screen, and see if any accounts show up there. If they do, add a new one, and see if a folder with the same name shows up in the \mercury\mail\ folder.

(Sorry it took a while to respond. Been out of town for a funeral.)
taustin
 
Posts: 150
Joined: 24. September 2004 00:23
Location: Huntington Beach CA


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 100 guests