close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Send an email to users of a select multiple after success in upload

Thread began 12/22/2018 3:25 pm by María Luisa | Last modified 12/26/2018 12:25 pm by Ray Borduin | 211 views | 1 replies |

María Luisa

Send an email to users of a select multiple after success in upload

Hello:
I have a form that uploads and writes to a database. The idea is that, from this form, documents are uploaded to share with one, some or all users, therefore, there is a multiple select and this works well. But, in addition, the idea is to send an email to the user or users with whom you want to share the document. And here my problems begin.

I thought about making a script that would pick up the emails of the user or the selected users in the select ... This is the script:

php:
<?php

if(isset($_POST["us_alias"]) && $WA_DFP_UploadStatus["WA_UploadResult1"]["statusCode"] == 1) {
    foreach(
$_POST["us_alias"] as $clave=>$valor){
        
$rsMail = new WA_MySQLi_RS("rsMail",$conexion_i,1);
$rsMail->setQuery("SELECT * FROM usuarios_pml WHERE usuarios_pml.us_nombre = ".GetSQLValueString($valor"text"));
$rsMail->execute();
        }
?>



I put this script just on the one corresponding to the WA mailing, which is the following:

php:
<?php

if ($WA_DFP_UploadStatus["WA_UploadResult1"]["statusCode"] == 1)     {  //WA Universal Email
  
$Email = new WA_Email("Gestion_documentos");
  
$Email->From "noreply@webpage.es";
  
$Email->CharSet "UTF-8";
  
$Email->Method "smtp";
  
$Email->Host "smtp.webpage.es";
  
$Email->Port "25";
  
$Email->SMTPAuth true;
  
$Email->Username "noreply@webpage.es";
  
$Email->Password "XXXXXXXX";
  
$Email->addTo("".($rsMail->getColumnVal("us_mail"))  ."");
  
$Email->BodyFile "../webassist/email/templates/WebAssist-Block/Block.php";
  if (
function_exists("rel2abs") && $Email->Redirect$Email->Redirect $Email->Redirect?rel2abs($Email->Redirect,dirname(__FILE__)):"";
  for (
$emailGroup=0$emailGroup<sizeof($Email->To); $emailGroup++) {
    
$Email->Subject "XXXXXX le ha enviado un nuevo archivo";
    
$Email->send($emailGroup);
  }
  
$Email->close();
}
?>



And what happens is that something causes a kind of collapse on the page because it stays blank in the browser, it shows no errors although I have

php:
<? Php

error_reporting (E_ALL && ~ E_NOTICE);
?>



Does anyone have an idea of ​​how to fix it?

Thank you

Sign in to reply to this post

Ray BorduinWebAssist

This should be above the email code:

php:
<?php

if(isset($_POST["us_alias"]) && $WA_DFP_UploadStatus["WA_UploadResult1"]["statusCode"] == 1) {
    foreach(
$_POST["us_alias"] as $clave=>$valor){
?>
<?php
$rsMail 
= new WA_MySQLi_RS("rsMail ",$conexion_i,0);
$rsMail ->setQuery("SELECT * FROM usuarios_pml WHERE usuarios_pml.us_nombre = ?");
$rsMail ->bindParam("s""".$valor  ."""-1"); //noparam
$rsMail ->execute();
?>



and this should be below it:

php:
<?php

        
}
}
?>
Sign in to reply to this post
Did this help? Tips are appreciated...

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...