Announcement

Collapse
No announcement yet.

Email From a list

Collapse
X
  • 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:

    http://www.scriptcase.net/forum_en_u...10011#msg10011

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

    Regards,
    Scott.

    Comment


    • #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:

      Error

      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:

      Code:
      $tot = count([total_chked]);
      $contacts = "";
      
      for($x=0;$x<$tot;$x++){
      $contacts .= [total_chked][$x];
      
      if($x == ($tot-1)){
      $contacts .= "";
      }else{
      $contacts .= "; ";
      }
      }
             
      /**
       * Send a simple email
       */
      
      // Email parameters
      $mail_smtp_server = '192.168.xx.xxx';    // SMTP server name or IP address
      $mail_smtp_user  = '';          // SMTP user name
      $mail_smtp_pass  = '';        // SMTP password
      $mail_from    = 'no-reply@ouremail.com';     // 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="http://approvals.hss-mms.com/approval">Here</a>.'; // Message body
      $mail_format   = 'H';            // Message format: (T)ext or (H)tml
      
      
      // Send email
      sc_mail_send($mail_smtp_server,
             $mail_smtp_user,
             $mail_smtp_pass,
             $mail_from,
             $mail_to,
             $mail_subject,
             $mail_message,
             $mail_format);
       
       echo "<table width='300px' border='1' bordercolor='#000000' cellpadding='0' cellspacing='0'>
      <tr>
      <td colspan='2'><strong> ($tot) An email was sent to: <strong></td>
      </tr>
      <tr>
      <td><font color='#003366'><strong> $contacts </strong></font> </td>
      </tr>
      </table>"
      ;

      Comment


      • #4
        Re: Email From a list

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

        Regards,
        Scott.

        Comment


        • #5
          Just a note-
          You can find this in the ScriptCase Samples page:
          http://www.scriptcase.net/scriptcase-samples/

          Comment

          Working...
          X