21
PTlooker
Re: Admin > mail users > image
  • 2004/12/29 20:49

  • PTlooker

  • Just can't stay away

  • Posts: 447

  • Since: 2003/6/15


Yes, nut you cant say that because you dont know if its important to me or not to send html emails, so please do say that king of stuff...
If anyone know how to solve this please help...
Dave_L u seems to know how dont you?

22
PTlooker
Re: Admin > mail users > image
  • 2005/1/9 20:54

  • PTlooker

  • Just can't stay away

  • Posts: 447

  • Since: 2003/6/15


anyone?

23
spiff
Re: Admin > mail users > image
  • 2005/1/11 18:26

  • spiff

  • Just popping in

  • Posts: 47

  • Since: 2003/4/16


Well, 2.0.1 is starting to get old... You really should consider upgrading Xoops, however painful that may be, if only for security reasons. Template changes will survive the upgrade, and language file changes can easily be backed up before the upgrade, then restored.

Have you tried XMail? I doubt it's compatible with 2.0.1, but you never know...

If that doesn't work either, you can try the following, but that's tested with 2.0.9.2 (latest version) and may not even work under 2.0.1...

(Keep a log of this change in your XOOPS log file, it will serve you as a check list for future upgrades).

Before anything, BACK UP the following files, under \modules\system\admin\mailusers\:
mailusers.php -> mailusers.php.old
mailform
.php -> mailform.php.old

To send in HTML format, in file \modules\system\admin\mailusers\mailusers.php, replace (around line 185):
$xoopsMailer->send(true);

with:
if (!empty($_POST['mail_format_html'])) {
  
$xoopsMailer->multimailer->IsHTML(true);
  
$body $myts->oopsStripSlashesGPC($_POST['mail_body']);
  
$body $myts->nl2br($body);
  
$xoopsMailer->setBody($body);
}
$xoopsMailer->send(true);

To have a checkbox appear in the form to let you choose between formats, in file \modules\system\admin\mailusers\mailform.php (around line 82), replace:
$body_text = new XoopsFormTextArea($body_caption"mail_body"""10);

with:
$body_text = new XoopsFormTextArea(''"mail_body"""10);
$html_cbox = new XoopsFormCheckBox(''"mail_format_html");
$html_cbox->addOption(1_AM_MAILHTML);
$body_tray = new XoopsFormElementTray($body_caption"");
$body_tray->addElement($body_text);
$body_tray->addElement($html_cbox);

And at the bottom of the same file, replace:
$form->addElement($body_text);

with:
$form->addElement($body_tray);

Now add the language tag in the language file (if you only use one language in your site, you can simply replace _AM_MAILHTML in the code above with 'Send as html'), in files /modules/system/language/ * /admin/mailusers.php:
define(_AM_MAILHTML,'Send as HTML');

If this breaks Xoops, you can always revert:
mailusers.php.old -> mailusers.php
mailform
.php.old -> mailform.php

Good luck,
Eric

Login

Who's Online

322 user(s) are online (267 user(s) are browsing Support Forums)


Members: 0


Guests: 322


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits