No announcement yet.

Email From a list

  • Filter
  • Time
  • Show
Clear All
new posts

  • Email From a list

    I want to be able to send a canned email to user/users listed in my user table based on a selection from an editable gride via check box.

    My goal is that a user can click on a button from any of my application that would take them to a form/editable grid has a list of users that can be check marked from there they hit a send/submit button and a canned email is sent to those selected users. I am very new to scriptcase and have really no idea on how I can make this work. Any thoughts example code that anyone can help me with? This is very important feature that my boss wants added into our final application.

  • #2
    Re: Email From a list

    Have a look at the following:

    Then look at the SC online example for checkbox usage to gather the list of names.



    • #3
      Re: Email From a list

      Thanks! I got it work and send emails to the people i select. I do get an error message shortly after the email sends.

      The error says this:


      Uncaught Error of type [Swift_ConnectionException] with message [There was a problem reading line 1 of an SMTP response. The response so far was:
      []. It appears the connection has died without saying goodbye to us! Too many emails in one go perhaps? (fsockopen: #0) ]
      @0 Email_apl::controle() in C:Program FilesNetMakev5wwwrootscriptcaseappApprovalEmailEma il.php on line 2083
      @1 Email_apl::Submit() in C:Program FilesNetMakev5wwwrootscriptcaseappApprovalEmailEma il.php on line 1181
      @2 Swift::send() in C:Program FilesNetMakev5wwwrootscriptcaseappApprovalEmailEma il.php on line 1418

      Any thoughts?

      Here is the code I am useing:

      $tot = count([total_chked]);
      $contacts = "";
      $contacts .= [total_chked][$x];
      if($x == ($tot-1)){
      $contacts .= "";
      $contacts .= "; ";
       * Send a simple email
      // Email parameters
      $mail_smtp_server = '';    // SMTP server name or IP address
      $mail_smtp_user  = '';          // SMTP user name
      $mail_smtp_pass  = '';        // SMTP password
      $mail_from    = '';     // From email
      $mail_to     = $contacts;    // To email
      $mail_subject   = 'Request Waiting For Approval';      // Message subject
      $mail_message   = 'You have new requests in your que that need to be approved. Please log into the HSS Approval database by clicking <a href="">Here</a>.'; // Message body
      $mail_format   = 'H';            // Message format: (T)ext or (H)tml
      // Send email
       echo "<table width='300px' border='1' bordercolor='#000000' cellpadding='0' cellspacing='0'>
      <td colspan='2'><strong> ($tot) An email was sent to: <strong></td>
      <td><font color='#003366'><strong> $contacts </strong></font> </td>


      • #4
        Re: Email From a list

        How many are you sending? If you send 1 or 5, does it do the same thing?



        • #5
          Just a note-
          You can find this in the ScriptCase Samples page: