asterisk2billing.org
http://forum.asterisk2billing.org/

a2b_mail - just a suggestion
http://forum.asterisk2billing.org/viewtopic.php?f=23&t=7118
Page 1 of 1

Author:  smartcall [ Wed Feb 17, 2010 10:56 am ]
Post subject:  a2b_mail - just a suggestion

Hello and thanks for the work on a2b!

I use the latest version 1.5.1.

I needed a2b to send email in UTF-8. And I guess that this is what all of us eventually need. Especially those whose clients language is not latin based. So I added a line in function a2b_mail.
Code:
$mail->CharSet = 'UTF-8';

The file is lib/Misc.php. After that all the mails are UTF-8 encoded and perfectly readable in all email clients.

So my syggestion is to add this permanently to the code of a2b.

There is another thing that I noticed, but didn't look for the file to edit. The function substr could be replaced with mb_substr for proper shortening of clients names when the language is not latin, but this is not so important.

Thanks and keep up the good work!

Author:  areski [ Fri Mar 05, 2010 8:52 pm ]
Post subject:  Re: a2b_mail - just a suggestion

I followed your advice, committed in rev 2771.

Use the trac to publish an enhancement or bug fix.

Thanks,
/Areski

Author:  sverige [ Sat Sep 11, 2010 3:35 pm ]
Post subject:  Re: a2b_mail - just a suggestion

I have having the same issue. We need Russian. Were do I add this line?

* a2b_mail - function mail used in a2billing
*/
function a2b_mail($to, $subject, $mail_content, $from = 'root@localhost', $fromname = '', $contenttype = 'multipart/alternative')
{

$mail = new PHPMailer(true);

if (SMTP_SERVER) {
$mail->Mailer = "smtp";
} else {
$mail->Mailer = "sendmail";
}

$mail->Host = SMTP_HOST;
$mail->Username = SMTP_USERNAME;
$mail->Password = SMTP_PASSWORD;
$mail->Port = SMTP_PORT;
$mail->SMTPSecure = SMTP_SECURE;

if (strlen(SMTP_USERNAME) > 0)
$mail->SMTPAuth = true;


$mail->From = $from;
$mail->FromName = $fromname;
$mail->Subject = $subject;
$mail->Body = nl2br($mail_content); //$HTML;
$mail->AltBody = $mail_content; // Plain text body (for mail clients that cannot read HTML)
// if ContentType = multipart/alternative -> HTML will be send
$mail->ContentType = $contenttype;
$mail->AddAddress($to);
try {
$mail->Send();
} catch (phpmailerException $e) {
throw $e;
}

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/