Welcome Guest, Not a member yet? Register   Sign In
Error with email class in CI 3.1.8
#11

@ardavan,

I see no ["appName"] in your CI_Config dump.
Reply
#12

(04-05-2018, 12:18 AM)ardavan Wrote: i can't understand what's your mean by $this->email = "examplestring" and attribute $email = "examplestring"
can you please give me a sample code?

even im doing the same on another project with CI 3.1.5 and it works. idk why is not working in 3.1.8 !

The E-Mail Class work on 3.1.8. I have tested it.

PHP Code:
class Example extends CI_Controller {

    function 
__construct() {
        
parent::__construct();
        
        
$this->email 'example'// this is the problem. remove this line
    
}

    public function 
send_example_email()
    {

        
$this->email 'example'// this is the problem. remove this line
        
        /* You E-Mail Code*/
    
}


print the value $this->email
Reply
#13

@Paradinight

thanks for your highlight I totally forgot that I made that mistake. BUT now I have another issue haha which is valid_mail
Now because of the form validation, I get an error but the email is valid [email protected]
Reply
#14

If I remember right after checking the email class that the valid_email also checks the domain.

look at the code in the email class.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#15

(04-05-2018, 09:31 PM)ardavan Wrote: @Paradinight

thanks for your highlight I totally forgot that I made that mistake. BUT now I have another issue haha which is valid_mail
Now because of the form validation, I get an error but the email is valid [email protected]

Did you write valid_mail or valid_email? Error message?
Reply
#16

(This post was last modified: 04-06-2018, 01:26 PM by InsiteFX.)

If your using validate_email() it calls valid_email() which checks the domain address
that could be why your getting the error message.

SEE: validate_email() and valid_email() in the ./system/libraries/Email.php class.

Even the Form_validation library checks the domain name in valid_email().
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#17

(This post was last modified: 04-06-2018, 08:32 PM by ardavan.)

im using valid_email like this

PHP Code:
$this->form_validation->set_rules('email''lang:valid_email''trim|valid_email|is_unique[USERS.EMAIL]|required'); 
Reply
#18

(04-06-2018, 08:31 PM)ardavan Wrote: im using valid_email like this

PHP Code:
$this->form_validation->set_rules('email''lang:valid_email''trim|valid_email|is_unique[USERS.EMAIL]|required'); 

Codeigniter use filter_var does not check if the domain existse. The email is valid. What is the error?
Does the email exist in the user table?
Reply
#19

./system/libraries/Form_validation.php
PHP Code:
    /**
     * Valid Email
     *
     * @param    string
     * @return    bool
     */
    
public function valid_email($str)
    {
        if (
function_exists('idn_to_ascii') && preg_match('#\A([^@]+)@(.+)\z#'$str$matches))
        {
            
$domain defined('INTL_IDNA_VARIANT_UTS46')
                ? 
idn_to_ascii($matches[2], 0INTL_IDNA_VARIANT_UTS46)
                : 
idn_to_ascii($matches[2]);
            
$str $matches[1].'@'.$domain;
        }

        return (bool) 
filter_var($strFILTER_VALIDATE_EMAIL);
    } 

Now you can see that it is checking the email domain.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#20

(04-06-2018, 11:53 AM)Paradinight Wrote:
(04-05-2018, 09:31 PM)ardavan Wrote: @Paradinight

thanks for your highlight I totally forgot that I made that mistake. BUT now I have another issue haha which is valid_mail
Now because of the form validation, I get an error but the email is valid [email protected]

Did you write valid_mail or valid_email? Error message?

(04-06-2018, 11:40 PM)Paradinight Wrote:
(04-06-2018, 08:31 PM)ardavan Wrote: im using valid_email like this

PHP Code:
$this->form_validation->set_rules('email''lang:valid_email''trim|valid_email|is_unique[USERS.EMAIL]|required'); 

Codeigniter use filter_var does not check if the domain existse. The email is valid. What is the error?
Does the email exist in the user table?

The error is say the email should be a valid email address
Reply




Theme © iAndrew 2016 - Forum software by © MyBB