Page 1 of 2

Unofficial FAQ (w/Answers)

PostPosted: 07.08.2009, 21:42
by Steiner
Hello, I'm Steiner. (I am American although my name might advise otherwise, lol)

I love this script so much that I'm going to help answer some questions... feel free to ask your own questions here as well! I have this thread being watched so I'll get an email and reply as quickly as possible.

I'm going expand upon this thread as I come across things to make a somewhat unofficial FAQ. Feel free to add or comment my ideas, changes and/or answers.

SMTP, Gmail, non-phpmail() LAMP stacks

PostPosted: 07.08.2009, 21:49
by Steiner
Q: Does Collabtive support SMTP clients like gmail and other services requiring it to be secure and state ports?

A: Ok, yes this wonderful script does support SMTP on that level!

As most SMTP classes these days it allows the ssl:// protocol and :[port#] suffix.

Simply go into System administration, then down to the email settings.

Set Method to "SMTP", and in the Server field put;
Code: Select all
ssl://smtp.gmail.com:465

or
Code: Select all
ssl://smtp.gmail.com:587


As for the SMTP username, this will be the full email of a standing account, ex: yourname@domain.com.
And for SMTP password, this will be the same as if you were logging into your email.

NOTE: If using SSL (like gmail for instance) regardless of what you put in the Sender e-mail field, it will default to the SMTP username, however the Sender name will still reflect.
------------------
This also stands for other SMTP methods seeking ports and the secure linking... but this should be enough to wrap your heads around what needs to be done to make it work.

Notification, e-mail text format

PostPosted: 07.08.2009, 22:24
by Steiner
Q: Can we change the format in which our message emails are sent to the users and clients?

A: Of course!

Though it will take a little work on your end... since this is one of the very few things that isn't in a .tpl file.

Open /managemessage.php from your install root.
And somewhere around line:114 you will see a comment
Code: Select all
                if (!empty($user["email"]))
                {
                    if (is_array($sendto))
                    {
                        if (in_array($user["ID"], $sendto))
                        {
                            // send email
                            $themail = new emailer($settings);
                            $themail->send_mail($user["email"], "Message was posted", $message . " <a href = \"" . $url . "managemessage.php?action=showmessage&id=$id&mid=$themsg\">$title</a>");
                        }
                    }
                    else
                    
{
                        // send email
                        $themail = new emailer($settings);
                        $themail->send_mail($user["email"], "Message was posted", $message . " <a href = \"" . $url . "managemessage.php?action=showmessage&id=$id&mid=$themsg\">$title</a>");
                    }
                } 


Change how you see fit.
-----------------------------------
Example of my ../managemessage.php and ../include/class.emailer.php
Pay attention to the ../include/class.emailer.php changes, because this script users mysql_real_escape_string() in most of it's sql queries, so we have to drop the slashes in the email.

../managemessage.php
  • Added $project_obj = new project(); under //create message object
  • Added $project_info = $project_obj->getProject($id); to add the project info into our email template
  • Tweaked Template
Code: Select all

                if 
(!empty($user["email"]))
                {
                    $project_obj = new project();
                    $project_info = $project_obj->getProject($project['ID']);

                    if (is_array($sendto))
                    {
                        if (in_array($user["ID"], $sendto))
                        {
                            // send email
                            $themail = new emailer($settings);
                            $themail->send_mail($user["email"], "Message Regarding Project \"{$project_info['name']}\": $title", $message . "<br /><br /><a href = \"" . $url . "managemessage.php?action=showmessage&id=$id&mid=$themsg\">Reply Here</a>");
                        }
                    }
                    else
                    
{
                        // send email
                        $themail = new emailer($settings);
                        $themail->send_mail($user["email"],"Message Regarding Project \"{$project_info['name']}\": $title", $message  . "<br /><br /><a href = \"" . $url . "managemessage.php?action=showmessage&id=$id&mid=$themsg\">Reply Here</a>");
                    }
                }
 


../include/class.emailer.php
  • Added stripslashes() to $mailer->Subject & $mailer->Body
Code: Select all
<?php
/**
 * This class provides methods to handle emailing
 *
 * @author Open Dynamics <info@o-dyn.de>
 * @name emailer
 * @version 0.4.8
 * @package Collabtive
 * @link http://www.o-dyn.de
 * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v3 or later
 */
class emailer
{
    private $from;
    private $mailsettings;

    function __construct($settings)
    {
        $this->mailsettings = $settings;
    }


    /**
     * Send an email to a member
     *
     * @param string $to Recipient's email address
     * @param string $subject Subjectline of the mail
     * @param string $text Textbody of the mail, HTML allowed
     * @return bool
     */
    function send_mail($to, $subject, $text)
    {
        //create PHP Mailer object
        $mailer = (object) new PHPmailer();
        //setup PHPMailer
        $mailer->From = $this->mailsettings["mailfrom"];
        $mailer->FromName = $this->mailsettings["mailfromname"];  
        $mailer
->AddAddress($to);
        $mailer->Subject = stripslashes($subject);
        $mailer->Body = stripslashes($text);
        //send mail as HTML
        $mailer->IsHTML(true);
        //set charset
        $mailer->CharSet = "utf8";
        //set mailing method... mail, smtp or sendmail
        $mailer->Mailer = $this->mailsettings["mailmethod"];
        //if it's smtp , set the smtp server
        if($this->mailsettings["mailmethod"] == "smtp")
        {
            $mailer->Host = $this->mailsettings["mailhost"];
            //setup SMTP auth
            if($this->mailsettings["mailuser"] and $this->mailsettings["mailpass"])
            {
                $mailer->Username = $this->mailsettings["mailuser"];
                $mailer->Password = $this->mailsettings["mailpass"];
                $mailer->SMTPAuth = true;
            }
        
        
}
        
        if 
($mailer->Send())
        {
            return true;
        }
        else
        
{
            return false;
        }
    }
}

?>

Re: Unofficial FAQ (w/Answers)

PostPosted: 11.08.2009, 03:46
by Philipp
Stickied this

GoDaddy Setup

PostPosted: 26.04.2010, 10:51
by Eva
The GoDaddy setup is this...

In System Admin
Status: On
Sender Email: whatever you wish
Sender name: whatever you wish
Method: PHP mail() --THIS IS THE KEY! SMTP WILL NOT WORK WITH GD
Server: smtpout.secureserver.net
SMTP username: youremail@godaddydomain.com
SMTP pass: your email passord

I tried with both Gmail (you need SSL and port 465)

(thank you for posting this, cjt)

Re: Unofficial FAQ (w/Answers)

PostPosted: 05.05.2010, 16:18
by 219jondn
anyone know what the specific setup is for 1and1?
I am hoping ti is what eva said regarding leaving it as php because my smtp doesn't seemt o be working :(

Re: Unofficial FAQ (w/Answers)

PostPosted: 22.05.2012, 08:06
by kirbym9271
I am hoping I am doing this right. My web experience is about 5 years outdated. I've installed and set up a linux server with collabtive and have created and registered a domain name with godaddy. I will tell godaddy that I am doing my own webhosting on the linux server. I just want to be absolutely sure that since this is open source that I am not restricted to referencing collabtive in my domain name.

for example:

Would I be okay in using either name?

mywebsitename.net/collabtive
or
mywebsitename.net/projects

I'm sorry if this is a dumb question, like i said I'm kind of new at this right now.

thanks,
Matt

Re: Unofficial FAQ (w/Answers)

PostPosted: 22.05.2012, 15:29
by Eva
Hi Matt,

sure, it does not matter how you name the URL / subdomain / subfolder for your Collabtive installation.

Re: Unofficial FAQ (w/Answers)

PostPosted: 02.06.2013, 08:11
by wolff
Hello,
was wondering if anyone has gotten this to work with outlook.com? smtp.live.com? Thanks!

Re: SMTP, Gmail, non-phpmail() LAMP stacks

PostPosted: 10.07.2013, 23:48
by andy.swick
Steiner wrote:Q: Does Collabtive support SMTP clients like gmail and other services requiring it to be secure and state ports?


Attached are my settings, what am I missing?

Any help would be great!

Andrea