Categories > TinyButStrong general >

cannot send e-mail using Rmail under mergeblock

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: handoko
Date: 2011-03-29
Time: 16:56

cannot send e-mail using Rmail under mergeblock

Hi Skrol, all,

I trying to use Rmail php class to send email, under mergeblock like this
            $mail = new Rmail();                                       // Create the email object
            $mail->setFrom($g->adminemail);     // Set the From: address
            $mail->setSubject($r->broadcasttitle);                           // Set the subject
            $mail->setPriority('high');                                // Set the priority
            $mail->setHTML($r->broadcastemail); // Set the HTML (optional)
            $mail->setReceipt('handoko75@gmail.com');                        // Set a receipt
            $result = $mail->send($a['email']);      // Send the email

$main = new clsTinyButStrong;
$main->LoadTemplate(THEMES_DIR.$template);
$main->MergeBlock('grp','mysql','select * from eroza_usergroup');
$main->MergeBlock('blk',$rs);

$main->show(TBS_NOTHING);   
$htmlMain    = $main->Source;


is there any wrong in my code above, or the mergeblock doesn't support this method?

Thanks in advance
By: Skrol29
Date: 2011-03-30
Time: 01:31

Re: cannot send e-mail using Rmail under mergeblock

Hi Handoko,

I cannot see the relation between the mailing and the TBS instance.
The TBS part seems ok if $rs is an array with the expected structure.

I think PHP is not case sensitive for methods, but it's should be:
$main->Show(TBS_NOTHING);
By: handoko
Date: 2011-03-30
Time: 16:36

Re: cannot send e-mail using Rmail under mergeblock

Thanks Skrol,

there is nothing to do with case sensitive,
what i would like to try is that i can send an email using Rmail php class under sub template,

Can you check my example site on http://test.srabut.com

I try send e-mail when you click ok button, but the result is multiple subtemple shown on the page.

can you help me.

Thanks
By: Skrol29
Date: 2011-03-30
Time: 21:22

Re: cannot send e-mail using Rmail under mergeblock

Any html I try to is is displaying the result of the main template.
And it's like when we click ok [ok] the sub templates are replaced with main template in the main template itself.
By: handoko
Date: 2011-03-30
Time: 21:28

Re: cannot send e-mail using Rmail under mergeblock

the email is send successfully,

but the problem is multiple subtemplate that i don't want it.
how to solve the problem, i just add this code under
if (isset($_POST['btn_ok'])) {
  // Imagine we check the login/password...
    $err_log = 1;


require_once('Rmail/Rmail.php');
   
    $mail = new Rmail();

  
    $mail->setFrom('Handoko <handoko75@gmail.com>');
   
   
    $mail->setSubject('Test email');
   
  
    $mail->setPriority('high');

  
    $mail->setText('Sample text');
   
 
    $mail->setReceipt('xxx@gmail.com');
      
    $address = 'xxx@gmail.com';
    $result  = $mail->send(array($address));

Thanks
By: handoko
Date: 2011-03-31
Time: 01:44

Re: cannot send e-mail using Rmail under mergeblock

Solved,

the problem is come from subtpl_login.html that contain

action="[onshow...script_name]"

i replace with action=""

and the problem solved,. you can try it,
for your info, i able to use User Friendly URL also

thanks