Problems, need help? Have a tip or advice? Post it here.
10 posts Page 1 of 1
Hello,
I've problem when using Extended Users. It cannot send email when someone register into my site.

Here's my register code:
Code: Select all
<cms:if k_logged_in >
        <!-- what is an already logged-in member doing on this page? Send back to homepage. -->
        <cms:redirect k_site_link />
    </cms:if>
   
    <!-- are there any success messages to show from previous actions? -->
    <cms:set success_msg="<cms:get_flash 'success_msg' />" />
    <cms:if success_msg >
        <div class="alert alert-success fade in">
    <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
           
        <div class="notice">
            <cms:if success_msg='1' >
                Your account has been created successfully and we have sent you an email.<br />
                Please click the verification link within that mail to activate your account.
            <cms:else />
                Activation was successful! You can now log in!<br />
                <a href="<cms:login_link redirect=k_site_link />">Login</a>
            </cms:if>
        </div>
       

        </div>
    <cms:else />

       
       
        <!-- now the real work -->
        <cms:set action="<cms:gpc 'act' method='get'/>" />
       
        <!-- is the visitor here by clicking the account-activation link we emailed? -->
        <cms:if action='activate' >
            <h1>Activate account</h1>
       
            <cms:process_activation />
           
            <cms:if k_success >
                 <cms:set_flash name='success_msg' value='1' />
                 <cms:redirect k_page_link />         
            <cms:else />
                <cms:show k_error />
            </cms:if>
       
        <cms:else />
           
            <!-- this ia regular databound-form -->
    <cms:form style="color:white" class="form-signin" masterpage=k_user_template
                mode='create'
                enctype='multipart/form-data'
                method='post'
                anchor='0'
                >

                <h1 class="form-signin-heading">Register</h1>
                <cms:if k_success >       

                             

                    <cms:db_persist_form
                    _invalidate_cache='0'
                    k_page_name = k_user_title
                    />                   

                    <cms:if k_success >
                       
                        <cms:send_mail from='<cms:php>echo K_EMAIL_FROM;</cms:php>' to=frm_extended_user_email subject='New Account Confirmation' debug='1'>
                            Please click the following link to activate your account:
                            <cms:activation_link   frm_extended_user_email   />

                            Thanks,
                            Website Name
                        </cms:send_mail>
                                               
                        <cms:set_flash name='success_msg' value='2' />
                        <cms:redirect url='/users/profile.php' />
                    </cms:if>
                </cms:if>

                <cms:if k_error >
                    <font color='red'><cms:each k_error ><cms:show item /><br /></cms:each></font>
                </cms:if>       

                <br>
                <cms:input style="height:45px" class="form-control" placeholder="Username" name='k_page_title' type='bound' />
               
               
                <cms:input style="height:45px;border-radius: 0px 0px 0px 0px;box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);" class="form-control" placeholder="Email" name='extended_user_email' type='bound' />

                <cms:input style="height:45px;border:none;border-radius: 0px 0px 0px 0px;" class="form-control" placeholder="Password" name='extended_user_password' type='bound' /> 
       
                <cms:input style="height:45px;border:none;border-radius: 0px 0px 3px 3px;" class="form-control" placeholder="Ulangi Password" name='extended_user_password_repeat' type='bound' />   
           
                <br>
                <input style="height:45px" class="btn btn-lg btn-primary btn-block" type="submit" name="submit" value="Buat Akun"/> 
       
        <!-- optionally display links for 'Create account' and 'Lost password' -->
            <p></p>
            <span style="font-weight:bold">
        <cms:if k_user_registration_template >
            Punya akun? <a href="<cms:link k_user_login_template />" />Login disini</a> <br>
        </cms:if>
        </span>

            <hr>
            Dengan melakukan Pendaftaran di website <strong>"Desain360.com"</strong> , kami berhak untuk mengakses akun anda tanpa pemberitahuan sebelumnya dengan tujuan keamanan.
           
            <p></p>
            <a href="<cms:show k_site_link/>"><i class="fa fa-angle-left" aria-hidden="true"></i> Kembali ke halaman utama</a>

            </cms:form>
           
        </cms:if>
    </cms:if>

Thanks in advance.
Hi,

Prima fascie, the part highlighted below seems to be the problem -
<cms:send_mail from='<cms:php>echo K_EMAIL_FROM;</cms:php>' to=frm_extended_user_email subject='New Account Confirmation' debug='1'>

You should use double-quotes there instead of the single-quotes (please see http://docs.couchcms.com/concepts/setti ... eters.html if you are unclear about this point).

So your code should become as follows -
Code: Select all
<cms:send_mail from="<cms:php>echo K_EMAIL_FROM;</cms:php>" to=frm_extended_user_email subject='New Account Confirmation' debug='1'>

As an alternative, you may use the following as the K_EMAIL_FROM constant is also available as a Couch variable -
Code: Select all
<cms:send_mail from=k_email_from to=frm_extended_user_email subject='New Account Confirmation' debug='1'>

Hope it helps.
It stilll not working here.

Before i use extended users, i use Members module. Its that something wrong with it? I have deleted all data from the members module from the addon folder.
I see you have 'debug' set to 1. That should log the email details in log.txt of your site's root.
What does that report? Do all the parameters show up as ok?

Regarding the member's question - I don't think that has any bearing on this problem.
KK wrote: I see you have 'debug' set to 1. That should log the email details in log.txt of your site's root.
What does that report? Do all the parameters show up as ok?

Regarding the member's question - I don't think that has any bearing on this problem.

Here's the log information:

Code: Select all
Delivery Failed
=======================[2017-01-30 21:44:45]=======================
From: xxx@site.com
To: xxx@icloud.com
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Subject: New Account Confirmation
Message:
                            Please click the following link to activate your account:
                            http://site.com/users/register/?act=activate&key=6bd99443a2b87c9c2780c95afe64e3cb%7Cy3gZbHr6oJbCXBQWKY4QyUfl3IuXrRHp%7C1485873885%7C35f3e1a39dba453aba5a039e9adfff97

                            Thanks,
                            Website Name
The output seems to be fine.

Could you please PM me your site's FTP + Couch super-admin creds?
Thanks for the creds.

I had a look and found that your host has disabled the mail() function. Following appears in the error log -
[11-Feb-2017 11:24:57 UTC] PHP Warning: mail() has been disabled for security reasons

Ok, so that leaves us with only the alternative of falling back to SMTP using phpmailer (http://www.couchcms.com/forum/viewtopic ... 911#p22911).

I have already uploaded and enabled the phpmailer addon on your site.
Please just edit the phmailer/config.php file to enter your GMail creds in it. The same config file has a 'debug' option. Temporarily set it to '1' and keep a watch om the log file to see how things go.

Hope it helps.
KK wrote: Thanks for the creds.

I had a look and found that your host has disabled the mail() function. Following appears in the error log -
[11-Feb-2017 11:24:57 UTC] PHP Warning: mail() has been disabled for security reasons

Ok, so that leaves us with only the alternative of falling back to SMTP using phpmailer (http://www.couchcms.com/forum/viewtopic ... 911#p22911).

I have already uploaded and enabled the phpmailer addon on your site.
Please just edit the phmailer/config.php file to enter your GMail creds in it. The same config file has a 'debug' option. Temporarily set it to '1' and keep a watch om the log file to see how things go.

Hope it helps.

I have try the phpmailer, but the mail never arriving. And this is the log txt:
Code: Select all
=======================[2017-02-12 13:30:41]=======================
From: xxx@desain360.com
To: xxx@cyrusnetwork.co
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Subject: Password reset requested
Message:           
                A request was received to reset your password for the following site and username:
                http://desain360.com/
                Username:

                To confirm that the request was made by you please visit the following address, otherwise just ignore this email.
               
            

Delivery Success
setiawanfarlin wrote:
KK wrote: Thanks for the creds.

I had a look and found that your host has disabled the mail() function. Following appears in the error log -
[11-Feb-2017 11:24:57 UTC] PHP Warning: mail() has been disabled for security reasons

Ok, so that leaves us with only the alternative of falling back to SMTP using phpmailer (http://www.couchcms.com/forum/viewtopic ... 911#p22911).

I have already uploaded and enabled the phpmailer addon on your site.
Please just edit the phmailer/config.php file to enter your GMail creds in it. The same config file has a 'debug' option. Temporarily set it to '1' and keep a watch om the log file to see how things go.

Hope it helps.

I have try the phpmailer, the log was Delivery Success but the mail never arriving. And this is the log txt:
Code: Select all
=======================[2017-02-12 13:30:41]=======================
From: xxx@desain360.com
To: xxx@cyrusnetwork.co
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Subject: Password reset requested
Message:           
                A request was received to reset your password for the following site and username:
                http://desain360.com/
                Username:

                To confirm that the request was made by you please visit the following address, otherwise just ignore this email.
               
            

Delivery Success
I tried sending mail to myself and the email *did* arrive.
So, things are working.

Perhaps the mail that you sent ended up in spam or something.
You need to find that out for yourself.
10 posts Page 1 of 1
cron