>> Home > M5 PopMonger: Powerful Inbound Email Processing PopMonger Home | My Mach5 | Download | Support | Buy Popmonger  
Online Manual
PopMonger Links


Untitled Document

Explore M5 Mailer

Take the bulk out of email! TM

Use your own data
Personal email merge
Send individual email
HTML and/or text
Handy email templates


Explore M5 Subscriber

Web-based list management made simple!

Simple subscribe tool
Opt-in confirmed
Track reads and clicks
Custom matching look
Free for up to
        5000 contacts

 

JScript with PopMonger

The class definitions for JScript are:

JScript

  class object Popmonger
String HeaderText;
String BodyText;
String MessageText;
String FailedAddress;
String HeaderField(String sHeader_name);
String Field(int iFieldNumber);
int FieldsCount;
String MIMEPart(int iPartNumber);
int MIMEPartsCount;
void RedirectMessage(String "sTo_address1,To_address2,To_address3");
void ReplyWithText(String sFrom_address, String sSubject, String sReply_text);
void SendMail(String sFrom_address, String sTo_address,
String sSubject_text, String sBody_text, String sEx_headers);
void SaveToFile(sFile_name, sText_to_save, bIsAppend);

Jscript Examples:

  • Insert Bounced Email into MsSql

  • Insert into Access

  • Redirect to Multiple Addresses

    • Insert Bounced Email into MsSql

      This example shows how to insert a bounced address from a failed email into an MS SQL database:

      <?

      var serverName; //IP address of server
      var databaseName; //Name of database
      var username; //Username
      var password; //Password

      var cnn; //Connection object
      var connString; //Connection string
      var query; //SQL query

      serverName = "host";
      databaseName = "database";
      username = "username";
      password = "password";

      cnn = new ActiveXObject( "ADODB.Connection" ); //Create new ADO connection
      connString = "Driver={SQL Server};Server=" + serverName + ";Database=" + databaseName + ";Uid="+ username + ";Pwd=" + password;
      cnn.Open( connString ); //Open database

      query = "INSERT INTO table ( field ) VALUES( '" + popmonger.FailedAddress + "' )";

      cnn.execute( query ); //Execute SQL query
      cnn.Close(); //Close database connection

      ?>


      Back to Examples

      Insert into Access

      This script will insert an entry from PopMonger into a MS Access database using Jscript:

      <?

      var dbLocation; //Database location
      var cnn; //Connection
      var sSQL; //SQL query
      dbLocation = "C:\\databases\\mailing database.mdb"; //Set path to database
      cnn = new ActiveXObject( "ADODB.Connection" ); //Create new ADO connection
      cnn.Open( "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + dbLocation ); //Open database
      sSQL = "INSERT INTO table1 ( field1 , field2 ) VALUES('" + popmonger.Field(0) + "' , '" + popmonger.Field(1) + "')"; //Set SQL query
      cnn.execute( sSQL ); //Execute SQL query
      cnn.Close(); //Close database connection

      ?>


      Back to Examples

      Redirect to Multiple Addresses

      <?

      var emails = new Array( "[email protected]" , "[email protected]" , "[email protected]" );

      for( var i = 0; i < emails.length; i++ ) {
      popmonger.RedirectMessage( emails[i] );
      }

      ?>


      Back to Examples

    Home   |   Site map   |   Analyzer   |   Mailer   |   PopMonger   |   Resources   |   Customers and Partners  |   Contact
    Mach5 is a trademark of Mach5 Development, in use since 2000.