• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 264
  • Last Modified:

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 = me@example.com

; 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]
sql.safe_mode = Off

[ODBC]
;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


and
*******************************************************
; configuration for fake sendmail

[sendmail]

; you must change mail.mydomain.com to your smtp server

smtp_server=localhost


; 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

;default_domain=local

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

;error_logfile=error.log

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

;debug_logfile=debug.log

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

;auth_username=
;auth_password=

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

;pop3_server=
;pop3_username=
;pop3_password=

; 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

;force_sender=me@localhost

; 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

;hostname=localhost
*********************************************************
0
Adnan
Asked:
Adnan
  • 6
  • 4
1 Solution
 
RoonaanCommented:
What is your mail server's correct address?

-r-
0
 
AdnanAuthor Commented:
IP ADRESS to my mail server is 193.213.115.8 or shod i install Mail Access Monitor for SendMail 3.2 from download.com?
0
 
AdnanAuthor Commented:
roonan can u plz guide me thro this problem?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
RoonaanCommented:
Hi,

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

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

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

-r-
0
 
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 your.email in C:\Programfiler\xampp\htdocs\PhP1\PhP_Uke6\include\WikiHtml\SendPassword_mail.php on line 72
0
 
RoonaanCommented:
Then you probably need to use:

mail('someone@somedomain.com', ...
rather than

mail('someone', ...

-r-
0
 
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 {
                               //$confirm_code=md5(uniqid(rand()));
                               // value sent from form
                              $email=$_POST['email'];

                        // table name
                        $tbl_name=wikiusers;

                        // retrieve password from table where e-mail = $email_to(mark@phpeasystep.com)
                        $sql="SELECT password FROM $tbl_name WHERE email='$email'";
                        $result=mysql_query($sql);

                        // if found this e-mail address, row must be 1 row
                        // keep value in variable name "$count"
                        $count=mysql_num_rows($result);

                        // compare if $count =1 row
                        if($count==1){

                              $rows=mysql_fetch_array($result);

                              // keep password in $your_password
                              $your_password=$rows['password'];

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

                        // send e-mail to ...
                        $to=$email;

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

                        // From
                        $header="from: your name <gonadn@nith.no>";

                        // 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
                  if($sentmail){
                        print "Passordet har blitt sendt til mail addressen din.!";
                  }
                  else {
                        print "Kan ikke sende passord til mail add din.!";
                  }
}


                  }}}
0
 
RoonaanCommented:
What did you fill in for $_POST['email']; ?

-r-
0
 
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......;)
0
 
AdnanAuthor Commented:
thanks for helping roonaN
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now