getting warning when i try to send password to mail......!! can some one help me whith settings for sendmail?

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:\Programfiler\xampp\htdocs\PhP1\PhP_Uke6\include\WikiHtml\SendPassword_mail.php on line 72
Kan ikke sende passord til mail add din.!

her is my php.ini

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

; For Win32 only.
;sendmail_from =

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path = "C:\Programfiler\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 =

sql.safe_mode = Off

;odbc.default_db    =  Not yet implemented
;odbc.default_user  =  Not yet implemented
;odbc.default_pw    =  Not yet implemented

; Allow or prevent persistent links.
odbc.allow_persistent = On

; Check that a connection is still valid before reuse.
odbc.check_persistent = On

; Maximum number of persistent links.  -1 means no limit.
odbc.max_persistent = -1

; Maximum number of links (persistent + non-persistent).  -1 means no limit.
odbc.max_links = -1

; Handling of LONG fields.  Returns number of bytes to variables.  0 means
; passthru.
odbc.defaultlrl = 4096

; configuration for fake sendmail


; you must change to your smtp server


; the default domain for this server will be read from the registry
; this will be appended to email addresses when one isn't provided
; if you want to override the value in the registry, uncomment and modify


; log smtp errors to error.log (defaults to same directory as sendmail.exe)
; uncomment to enable logging


; create debug log as debug.log (defaults to same directory as sendmail.exe)
; uncomment to enable debugging


; if your smtp server requires authentication, modify the following two lines


; if your smtp server uses pop3 before smtp authentication, modify the
; following three lines


; to force the sender to always be the following email address, uncomment and
; populate with a valid email address.  this will only affect the "MAIL FROM"
; command, it won't modify the "From: " header of the message content


; sendmail will use your hostname and your default_domain in the ehlo/helo
; smtp greeting.  you can manually set the ehlo/helo name if required

Who is Participating?
RoonaanConnect With a Mentor Commented:

Then you should just put the ip address or hostname in your php.ini:

[mail function]
; For Win32 only.
smtp_port = 25

Not forget to restart the server to make sure it re-reads the php.ini.

What is your mail server's correct address?

AdnanAuthor Commented:
IP ADRESS to my mail server is or shod i install Mail Access Monitor for SendMail 3.2 from
Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

AdnanAuthor Commented:
roonan can u plz guide me thro this problem?
AdnanAuthor Commented:
hmmmm....Oki now i get this message

Warning: mail() [function.mail]: SMTP server response: 553 5.5.4 <your name <your email>>... Domain name required for sender address in C:\Programfiler\xampp\htdocs\PhP1\PhP_Uke6\include\WikiHtml\SendPassword_mail.php on line 72
Then you probably need to use:

mail('', ...
rather than

mail('someone', ...

AdnanAuthor Commented:
i think maybe i get cloeaser know...i get error message from my cod ethat the email name i try to send password to does not exist in my db.......i am sending you my code so u can look at it

function Send_Password_mail(){
 $_mysqlHost["host"] = "localhost:25";
$_mysqlUsername["username"] = "gonadn";
$_mysqlPassword["password"] = "adn0420";
$_mysqlDatabase["database"] = "wiki";
 if ($_mysqlDatabase["database"]!= "wikiusers") {
                  $connection = mysql_connect('localhost','gonadn','adn0420')
                          or die (
            print mysql_error($connection));
               mysql_select_db ('wiki')
        or die (
           print mysql_error($connection));
                  if (!$connection) {
                     print("<div class=\"error\">Kunne ikke koble til databaseserveren: " . mysql_error() . "</div>");
                  else {
                         if (!@mysql_select_db("wiki", $connection)) {
                               print("<div class=\"error\">Kunne ikke koble til databasen: " . mysql_error() . "</div>");
                         else {
                               // value sent from form

                        // table name

                        // retrieve password from table where e-mail = $email_to(
                        $sql="SELECT password FROM $tbl_name WHERE email='$email'";

                        // if found this e-mail address, row must be 1 row
                        // keep value in variable name "$count"

                        // compare if $count =1 row


                              // keep password in $your_password

                        // ---------------- SEND MAIL FORM ----------------

                        // send e-mail to ...

                        // Your subject
                        $subject="Your password here";

                        // From
                        $header="from: your name <>";

                        // Your message
                        $messages= "Your password for login to our website \r\n";
                        $messages.="Your password is $your_password \r\n";
                        $messages.="more message... \r\n";

                        // send email
                        $sentmail = mail($to,$subject,$messages,$header);


                  // else if $count not equal 1
                  else {
                        print "Mail adressen finnes ikke i databasen";

                  // if your email succesfully sent
                        print "Passordet har blitt sendt til mail addressen din.!";
                  else {
                        print "Kan ikke sende passord til mail add din.!";

What did you fill in for $_POST['email']; ?

AdnanAuthor Commented:
i fill in the mail adress i want to send password to......but now suddenly i tryied again and it worked.....the mail hvae ben sent to my gmail adress......;)
AdnanAuthor Commented:
thanks for helping roonaN
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.