FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Sending Email from localhost

 


imagefree
i want to send email from localhost to my email address(es). Email addresses may be at gmail, yahoo or frihost.


Can you tell me how to do it? I am using php for this, but an error occurs.
Also i am using XAMPP.

Please help me in doing so.

Thanks
rvec
http://nl2.php.net/manual/en/function.mail.php

that should always work. If it doesn't something is wrong with your installation.
imagefree
This is the error message .

Code:
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 D:\xampp\htdocs\php\functions.php on line 117

(This php\ directory is mine (not of the server).

Here are extracts from php.ini:


Code:
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

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

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path = "D:\xampp\sendmail\sendmail.exe -t"

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =


Is something missing?

Here is the message:

Code:
$mail_body="<html>
   <body>
   <p>Congratulations! Your Account is Created at Example.<br></p>
   <p>Please click <a href=\"http://www.example.com/verify.php?id=$verification\">here</a> to varify your Email Address or simply copy<br>
   http://www.example.com/verify.php?id=$verification</p>
   </body>
   </html>";

mail($email,"Exmple.com Account Varification",$mail_body,"From: praisedpk@gmail.com");
jeremyp
imagefree wrote:
This is the error message .

Code:
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 D:\xampp\htdocs\php\functions.php on line 117

(This php\ directory is mine (not of the server).

Is something missing?


Yes.

An SMTP server. There isn't one running on localhost judging by the error message.
imagefree
what should i do?
rvec
I think you should reinstall XAMPP
Agent ME
Install a mailserver - I think XAMPP includes one.

Note that some email providers may auto-block emails from a standard DSL/cable/dial-up line as mostly spam emails come from those.
pollux1er
Try to download one to be more sure of it.
rvec
XAMPP includes one. No need to install another one. Reinstalling XAMPP will most likely solve the problem.
Stubru Freak
Or you could set SMTP to your ISP mail server, or a public one like Yahoo.
AOP Web Development
for xampp, i know that there is a mail server include mercury Mail i think.. all you need is to run the application and try to set up a localhost host email in your outlook express.. that pointing to webmaster@localhost and you can now start sending via localhost for testing..
mehulved
Maybe you just need to start mercury mail server from xampp page?
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.