Author Topic: not working after installation  (Read 8614 times)

0 Members and 1 Guest are viewing this topic.

dwatrous

  • Jr. Member
  • **
  • Posts: 3
not working after installation
« on: November 24, 2009, 04:02:47 PM »
Hello,

I've followed the steps and everything appears to be working except that I never appear online and the e-mail doesn't go through with the leave a message feature.  My hosting company is using nginx as the server and I notice one of your requirements is apache.  Is that really a problem?  PHP and MySQL are up to date.

Two questions:
1) how can I change the send e-mail feature to use SMTP and an account that I specify?
2) how can I trouble shoot why I never show up online?

Thanks.

dwatrous

  • Jr. Member
  • **
  • Posts: 3
Re: not working after installation
« Reply #1 on: November 24, 2009, 05:03:27 PM »
By adding a different operator and logging in as that operator I was able to get the icon to show up as online.  That's now working.

I still need to figure out #1, how to send email using SMTP...

dwatrous

  • Jr. Member
  • **
  • Posts: 3
Re: not working after installation
« Reply #2 on: November 24, 2009, 07:07:16 PM »
The reason I couldn't see an operator online was that I hadn't added him to a group (duh). 

To fix the e-mail problem I used this LGPL library:
http://phpmailer.worxware.com/index.php?pg=phpmailer

I didn't work out exactly how to incorporate it into the code for good, but this is what I've done in common.php

Code: [Select]
function webim_mail($toaddr, $reply_to, $subject, $body) {
global $webim_encoding, $webim_mailbox, $mail_encoding;

$headers = "From: $webim_mailbox\r\n"
   ."Reply-To: ".myiconv($webim_encoding, $mail_encoding, $reply_to)."\r\n"
   ."Content-Type: text/plain; charset=$mail_encoding\r\n"
   .'X-Mailer: PHP/'.phpversion();

$real_subject = "=?".$mail_encoding."?B?".base64_encode(myiconv($webim_encoding,$mail_encoding,$subject))."?=";

$body = preg_replace("/\n/","\r\n", $body);

$is_smtp = true;

if ($is_smtp) {
$mail             = new PHPMailer();

$mail->IsSMTP();
$mail->SMTPAuth   = true;                  // enable SMTP authentication
$mail->SMTPSecure = "ssl";                 // sets the prefix to the servier
$mail->Host       = "smtp.server.com";      // sets GMAIL as the SMTP server
$mail->Port       = 465;                   // set the SMTP port

$mail->Username   = "webmaster@mydomain.com";  // GMAIL username
$mail->Password   = "secretpass";            // GMAIL password

$mail->From       = "support@mydomain.com";
$mail->FromName   = "My Site";
$mail->Subject    = $real_subject;
$mail->AltBody    = $body; //Text Body
$mail->WordWrap   = 50; // set word wrap

$mail->MsgHTML($body);

$mail->AddReplyTo("support@ mydomain.com","My Site");

$mail->AddAddress($toaddr, $toaddr);

$mail->IsHTML(false); // send as HTML

$mail->Send();

} else {
@mail($toaddr, $real_subject, wordwrap(myiconv($webim_encoding, $mail_encoding, $body),70), $headers);
}
}

I'm still trying to work out how to get the formatting right, but that should get anyone with the same problem going.

What do you think about HTML formatting of the chat history.  Too many e-mail clients ignore line breaks in text and try to run them all  together.