• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.

Change User Email Address/Activation/Contact form

Status
Not open for further replies.

techscrap

Chevereto Member
when users try to register or update their email address i see the following error in the logs. i've dont a test account and i havent received an email for account creation confirmation

[error] [client 108.162.237.83] PHP Notice: Undefined variable: error in /includes/aus/functions/aus.general.functions.php on line 254, referer: http://sitename.com/members.php?page=admin&sp=manageusers&id=2


the contact form I have tested several times and see no errors so its tough to troubleshoot. can you offer assistance?
 
i'm still having issues with the contact form and have no errors anywhere to help me troubleshoot
 
i think my problem is phpmailer wants to use sendmail and i have postfix configured on my server. im not sure how to reconfig the class to use postfix
 
I've test and it says email sent. Do you manage to solve the problem or you still don't get the emails?
 
it saying sent but i'm not receiving the email

looking through the phpmailer config its looking for sendmail which i dont have

i think this is my issue but a debug log would be helpful
 
Go to includes/config.php and set error_reporting to true. The default email page seems to be bad... this should work better:

PHP:
<?php if(!defined('access') or !access) die('This file cannot be directly accessed.'); ?>
<?php include_theme_header(); ?>
    <div id="content" class="pages page_contact">
        <h1>Contact us</h1>
        <p>This is an example page for your chevereto site. You can edit this file located in <code>/content/themes/Peafowl/pages/contact.php</code></p>
        <p>As you may see, this example is quite different from others because it features a simple contact form using PHPMailer.</p>
        <p>Please notice that  you need to tweak the code on <code>contact.php</code> before this works.</p>
       
        <?php               
            if ($_POST['name'] and $_POST['email'] and $_POST['message']) {
                $result  = true;
                $name    = $_POST['name'];
                $email  = trim($_POST['email']);
                $message = $_POST['message'];
               
                $to = 'somemail@fakemail.com';
                $subject = 'Contact form example';
           
                $mailbody .= "Name: ".$name."\n";
                $mailbody .= "E-mail: ".$email."\n\n";
               
                $mailbody .= "Message: ".$message."\n\n";
                       
                $mailbody .= "IP: ".getenv("REMOTE_ADDR")."\n";
                $mailbody .= "Browser: ".getenv("HTTP_USER_AGENT")."\n\n";
               
                $use_phpmailer = false; // true: uses php mailer | false: uses the default mail() function
               
                // We are going to check the fields...
                if(check_email_address($email) and check_value($name) and check_value($message)) {
                    // Waht are we using?
                    if($use_phpmailer) {
                        // Hail PHPMailer!
                        require_once __CHV_PATH_CLASSES__ . 'class.phpmailer.php';
                        $mail = new phpmailer();
                        $mail->Mailer = "mail"; // mail|smtp|sendmail
                        //$mail->Host = ""; // SMTP host
                        //$mail->SMTPAuth = true; // Turn on SMTP auth (use when SMTP needs to indicate the user:password
                        //$mail->SMTPSecure = "ssl";
                        //$mail->Username = ""; // For SMTP
                        //$mail->Password = ""; // For SMTP
                        $mail->Timeout = 30;
                        $mail->From = $email;
                        $mail->FromName = $name;
                        $mail->AddAddress($to);
                        $mail->Subject = $subject;
                        $mail->Body = $mailbody;
                        $success = $mail->Send();
                    } else {
                        $success = mail($to, $subject, $mailbody); // $to, $subject, $mailbody
                    }
                    // Succes true...
                    if($success) {
                        $output = 'Form submited, we will contact you soon.';
                        $contact_class = 'contact-ok';
                    } else { // Oh no... errors.
                        $output = 'There was an error sending your request. Please try again later.';
                        $contact_class = 'contact-error';
                    }
                } else { // Invalid values...
                    $output = 'Please fill correct all the form fields.';
                    $contact_class = 'contact-error';
                }
            }
        ?>
        <?php if ($result) : ?>
        <div class="contact-result <?php echo $contact_class; ?>"><?php echo $output; ?></div>
        <?php endif; ?>
       
        <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
            <div><label for="name">Name:</label> <input type="text" name="name" id="name" /></div>
            <div><label for="email">E-mail:</label> <input type="text" name="email" id="email" /></div>
            <div><label for="message">Message:</label> <textarea name="message" id="message" ></textarea></div>
            <div><input type="submit" value="Send form" class="send-form"/></div>
        </form>
    </div>
 
<?php include_theme_footer(); ?>
 
SMTP Error: Could not connect to SMTP host.

ok i'm getting an error now but doing some googling everything looks right and even added port 465 but no luck

does phpmailer on have the option to use sendmail. been trying to avoid it but i may have no other choice

where are those debug logs located?
 
Sure,
PHP:
$mail->Mailer = "sendmail";
will use sendmail instead of mail(); Or you can remove the Mailer-> method and use this:

PHP:
$mail->IsSendmail();
It will do exactly the same.
 
right but im using postfix which i think is the root of the relay problem

been trying to find a way to modify phpmailer to use that instead
 
I don't think that you need to modify it. Postfix is SMTP so you will need to use $mail->Mailer = "smtp"; and then set the credentials (user, pass, auth=true). If no credentials are needed you must set:
PHP:
$mail->SMTPAuth = false;

You can also remove all the PHPmailer workaround and just use your own mail library (like pear mail). The contact.php is just a bundled example with the best PHP mail library (PHPMailer) but some users perhaps feel more comfortable using another method.
 
Status
Not open for further replies.
Back
Top