MX Send E-mail Forum :: Send email section to multiple mails

This thread was displayed: 0 times


Starting with 17th May 2007, Adobe Systems will stop offering support for any version of the discontinued InterAKT products. As a result, we will not answer to new support incidents starting with May 17th, 2007. Pending support incidents will still be followed in order to be closed. The product forums will remain open and be transformed in user-to-user forums. The general forums will be made read-only and not allow new posts or comments.

For more information about the affected products visit: www.interaktonline.com/Support/

View Threaded Show descending
Ptrck
05-24-2007 11:44:29 GMT +2

Hello,

I know that Interakt doesn't offer support anymore for there products but maybe someone in this forum can help me.

I tried to follow the "How to - How to send a page section by e-mail to multiple persons"

I am using PHP ADODB with Phakt; I have the latest release of MX Kollection Pro 3.7.1

I can't succeed in sending mail to multiple persons. Everytime a call the behavior, the mais is sent to the first mail of my recordset. Just like a normal send mail.

Here is the code of my page, maybe you guys can see what's wrong.

Thank you 


<?php
//Connection statement
require_once('../Connections/goecon.php');

//Aditional Functions
require_once('../includes/functions.inc.php');

// Load the tNG classes
require_once('../includes/tng/tNG.inc.php');

// begin Recordset
$query_user = "SELECT tbl_users.idconseiller, tbl_users.usr_prenom, tbl_users.uer_nom, tbl_users.usr_mail FROM tbl_users WHERE tbl_users.usr_typposte=6";
$user = $goecon->SelectLimit($query_user) or die($goecon->ErrorMsg());
$totalRows_user = $user->RecordCount();
// end Recordset

// begin Recordset
$query_test = "SELECT tbl_typeemploi.id_typeemp, tbl_typeemploi.int_typeemp FROM tbl_typeemploi";
$test = $goecon->SelectLimit($query_test) or die($goecon->ErrorMsg());
$totalRows_test = $test->RecordCount();
// end Recordset

ob_start();
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php //PHP ADODB document - made with PHAkt 3.7.1?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" c>
</head>

<body>
<?php
  $sectemailObj = new tNG_EmailPageSection();
  $sectemailObj->getCSSFrom(__FILE__);
  $sectemailObj->setFrom("{KT_defaultSender}");
  $sectemailObj->setSubject("test");
  $sectemailObj->setFormat("HTML/Text");
  $sectemailObj->setEncoding("ISO-8859-1");
  $sectemailObj->setImportance("Normal");
  $sectemailObj->BeginContent();
?>
  <table width="100%">
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><?php
  while (!$test->EOF) {
?>
            <table width="100%">
              <tr>
                <td><?php echo $test->Fields('id_typeemp'); ?> <?php echo $test->Fields('int_typeemp'); ?></td>
              </tr>
            </table>
            <?php
    $test->MoveNext();
  }
?></td>
      <td>&nbsp;</td>
    </tr>
  </table>
  <?php
  $sectemailObj->EndContent();
  do {
  $sectemailObj->setTo("{user.usr_mail}");
  $sectemailObj->Execute();
   } while($row_user = mysql_fetch_assoc($user))
?></bo

View full message
Back | Reply | Quote | Top
James Wyse
06-14-2007 00:00:25 GMT +2

I'm setting up the same thing, looping a page section thru a record set.

Mines not done yet, but I'm going to start like this

<?php

do{
  $sectemailObj = new tNG_EmailPageSection();
  $sectemailObj->getCSSFrom(__FILE__);
  $sectemailObj->setTo("{rsRoster.email_usr}");
  $sectemailObj->setFrom("camp@farminstitute.org");
  $sectemailObj->setSubject("Camp Reminder Pack :: The Farm Institute");
  $sectemailObj->setFormat("HTML/Text");
  $sectemailObj->setEncoding("ISO-8859-1");
  $sectemailObj->setImportance("Normal");
  $sectemailObj->BeginContent();
?>

Page content here

  <?php
  $sectemailObj->EndContent();
  $sectemailObj->Execute();

} while ($row_rsRoster = mysql_fetch_assoc($rsRoster));
?>

I think you need to reinstantiate the object each time through the loop.

I'll let you know how I make out.


James

Reply | Quote | Top
James Wyse
06-14-2007 04:21:58 GMT +2

This works:

<?php do { ?>
  <?php

  $sectemailObj = new tNG_EmailPageSection();
  $sectemailObj->getCSSFrom(__FILE__);
  $sectemailObj->setTo("{Recordset1.email_usr}");
  $sectemailObj->setFrom("123@123.org");
  $sectemailObj->setSubject("Test subject");
  $sectemailObj->setFormat("HTML/Text");
  $sectemailObj->setEncoding("UTF-8");
  $sectemailObj->setImportance("High");
  $sectemailObj->BeginContent();
?>
   content here
    <?php
  $sectemailObj->EndContent();
  $sectemailObj->Execute();
 
?>
  <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>


James

Reply | Quote | Top
Ptrck
06-14-2007 12:55:31 GMT +2

First off all Thanks for your reply.

It's not working with me. 

Wathever i do, the mail goes just to the first person in the recordset.

don't understand.

I thing wy code is right but...


<?php
//Connection statement
require_once('../Connections/goecon.php');

//Aditional Functions
require_once('../includes/functions.inc.php');

// Load the tNG classes
require_once('../includes/tng/tNG.inc.php');

// Load the common classes
require_once('../includes/common/KT_common.php');

// begin Recordset
$colname__det_poste = '1028';
if (isset($_GET['idposte'])) {
  $colname__det_poste = $_GET['idposte'];
}
$query_det_poste = sprintf("SELECT tbl_postes.dt_propo, tbl_postes.id_poste, tbl_postes.id_entreprise, tbl_postes.id_cons, tbl_postes.intitule, tbl_modecont.int_relation, tbl_postes.nbpostes, tbl_type_contrats.int_contrat, tbl_cntrec.int_cntrec, tbl_occupation.int_occup, tbl_postes.nbheures, tbl_postes.duree, tbl_postes.taches, tbl_postes.profil, tbl_postes.datedebut, tbl_postes.lieuposte, tbl_postes.observations, tbl_postes.pourvu, tbl_postes.validation, CONCAT(tbl_users.usr_prenom,\" \",tbl_users.uer_nom) AS cons, If(DateDiff(Now(),tbl_postes.dt_propo)<10,\"new\",Null) AS new, tbl_rom5.lib_rom5, tbl_rom5.id_rome5, tbl_entreprises.nom_ent FROM tbl_entreprises INNER JOIN ((((((tbl_type_contrats INNER JOIN tbl_postes ON tbl_type_contrats.id_c INNER JOIN tbl_occupation ON tbl_postes.occupation = tbl_occupation.id_occup) INNER JOIN tbl_cntrec ON tbl_type_contrats.id_cntrec = tbl_cntrec.id_cntrec) INNER JOIN tbl_users ON tbl_postes.id_c LEFT JOIN tbl_rom5 ON tbl_postes.cdrome = tbl_rom5.id_rome5) INNER JOIN tbl_modecont ON tbl_postes.modec ON tbl_entreprises.id_entr = tbl_postes.id_entreprise WHERE (((tbl_postes.id_poste)=%s)) ORDER BY tbl_postes.dt_propo DESC , tbl_postes.id_poste DESC", GetSQLValueString($colname__det_poste, "int"));
$det_poste = $goecon->SelectLimit($query_det_poste) or die($goecon->ErrorMsg());
$totalRows_det_poste = $det_poste->RecordCount();
// end Recordset

// begin Recordset
$colname__user = '-1';
if (isset($_POST['groupe'])) {
  $colname__user = $_POST['groupe'];
}
$query_user = sprintf("SELECT idconseiller, uer_nom, usr_prenom, usr_mail FROM tbl_users WHERE usr_typposte = %s", GetSQLValueString($colname__user, "int"));
$user = $goecon->SelectLimit($query_user) or die($goecon->ErrorMsg());
$totalRows_user = $user->RecordCount();
// end Recordset

// begin Recordset
$KTColParam1__interlo = '1222';
if (isset($_GET["idposte"])) {
  $KTColParam1__interlo = $_GET["idposte"];
}
$query_interlo = sprintf("SELECT tbl_contposte.Idcontpost, tbl_contposte.idposte, tbl_contposte.identr, tbl_contacts.id_contact, tbl_contacts.id_entrep, tbl_contacts.dt_creation, tbl_genre.abrevgenre, tbl_contacts.prenomcont, tbl_contacts.nomcont, tbl_contacts.fonction, tbl_contacts.tel, tbl_contacts.fax, tbl_contacts.mail, tbl_contacts.poste FROM ((tbl_contposte INNER JOIN tbl_contacts ON tbl_contacts.id_c INNER JOIN tbl_genre ON tbl_genre.id_genre=tbl_contacts.genre) WHERE tbl_contposte.idposte=%s  ORDER BY tbl_contacts.dt_creation DESC", GetSQLValueString($KTColParam1__interlo, "int"));
$interlo = $goecon->SelectLimit($query_interlo) or die($goecon->ErrorMsg());
$totalRows_interlo = $interlo->RecordCount();
// end Recordset

ob_start();

//PHP ADODB document - made with PHAkt 3.7.1
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php //PHP ADODB document - made with PHAkt 3.7.1?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<

View full message
Reply | Quote | Top
James Wyse
06-14-2007 23:52:18 GMT +2

Try starting with a really simple test page.  Then once the do loop is working, build it out from there, testing after each major change you make to see if it stops.

Could be that your recordset isn't pulling what you think it should, test that too.

I know this works!  I just created 4 pages using send page section by email from a recordset  like this.

James

Reply | Quote | Top
benjamin wende
02-15-2008 19:59:26 GMT +2

Jobbörse - stellenangebote - ausbildung - praktikum 

Good Solution.


Bennos


Reply | Quote | Top
© Adobe Systems Romania. All rights reserved.