- David Goodale
- Jonathan Deitch
- Cindy Papenheim
Email Data Extraction
- Go to the Database branch. Specify the name of the ODBC Data Source, the Table Name, the Recipient Column, and the Primary Key. To see more information about these fields, right click on the editbox and choose "Help".
- Go to the Incoming/Source branch. Check the "Process Remote Email" box. Click the "Add" button at the bottom of the table. Specify the details of the incoming email account (server name, protocol, port, user name, password).
- Go to the Incoming/Processing branch. Set the Processing Mode to "Add to database". In this mode, when an email is received, a new row is added to the database. The email address will be automatically added to the Recipient Column (specified on the Database branch).
- Check the "Process From:" box. The email address that is stored in the Recipient Column will be taken from the From: header of the incoming email.
On the Incoming Script branch, you can write a script that will extract other data from the email body, and store that data in the new database row. Consider the following email body:
To process this kind of message, the script would look like this:
[[let name = latch(-Body-, "Name:")]]
[[let age = latch(-Body-, "Age:")]]
[[let sex = latch(-Body-, "Gender:")]]
In this example, "name", "age", and "sex" are the names of database columns.
UnicodeWhen Gammadyne Mailer was developed back in 1999, it was internally designed for ASCII. If you want the extracted data to support unicode characters, the syntax is a little different. This modification of the above example demonstrates how to latch unicode:
Or, if the email is HTML instead of plain text, use this:
[[db_set_unicode("name", latch_html_unicode_until("Name:", "<br>"))]]
[[db_set_unicode("age", latch_html_unicode_until("Age:", "<br>"))]]
[[db_set_unicode("sex", latch_html_unicode_until("Gender:", "<br>"))]]
CompletionNow that the project is finished, choose Save As on the File menu to save the project. Send a test email to the email account. Then launch an Incoming Operation by pressing F7. If the row is not added to the database, examine the Incoming Log for error messages (press F10).
Once testing is completed, go to the Incoming/Processing branch and change Delete Messages to "When Processed". This ensures that an incoming email is only processed once.
Although this example demonstrates the most common type of email data extraction, many other ways of processing email data are possible. The built-in scripting language is capable of handling almost any conceivable scenario. Let us know if you need assistance.
See AlsoOpt-Out Forms