TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 05-05-2008, 01:53 PM   #1 (permalink)
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default Mail function..

Hi!

I'm having some trouble with my mail function.
Or well.. erh.. just look

php Code:
/**
        * @ Sends an activation email to the newly registered user
        *
        * @ Returns true or false
        **/

        private function sendActMail() {
           
            $sql = sprintf("    SELECT
                                    *
                                FROM
                                    `%s`"
,
                                   
                                $this->db->table['config']);
                               
            $query = $this->db->query($sql) or die(mysql_error());
            if($query) {
               
                $config = $this->db->fetch($query);
               
                $to = $this->reg_userinfo['email'];
                $subject = $config['actMail_subject'];
               
                    $subjectdata = array(
                   
                        'username' => $this->reg_userinfo['uname'],
                        'website' => $config['website_name']
                   
                    );
                   
                    $subject = $this->tpl->getParsed($subjectdata, $subject);
               
               
                $message = $config['actMail_message'];
               
                    $messagedata = array(
                   
                        'username' => $this->reg_userinfo['uname'],
                        'password' => $this->reg_userinfo['pword'],
                        'activationcode' => $this->reg_userinfo['actCode'],
                        'email' => $config['website_email'],
                   
                    );
                   
                    $message = $this->tpl->getParsed($messagedata, $message);
                   
                $headers = 'From: ' . $config['website_email'];
               
                $mail = mail($to, $subject, $message, $headers);
               
                if($mail) {
                   
                    return true;
                   
                }
               
                return false;
               
            }
           
            return false;
           
        }

gives me this..

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 C:\..user.php on line 358
I know this means that you can't send a mail from localhost..
but does the email function work other than that? Cause I can't test it.. since I don't have an smtp server..
__________________
Tanax is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 09:04 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design