VisualNEO Win Plugin Manual

neoMail Plugin Manual for VisualNEO Win

Plugin ID:com.visualneo.neomail
Version:1.0.1
Suite:VisualNEO Automation & AI Suite (Commercial)
Publisher:SinLios
Category:Network / SMTP Email Delivery

1. What is neoMail?

neoMail is a native email delivery engine designed for VisualNEO Win desktop applications. It enables you to send transactional emails, automated receipts, invoice attachments, notifications, and customer alerts directly from your software.

🌟 Key Highlights & Why SMTP2Go?

neoMail provides first-class, optimized support for SMTP2Go:

  • HTTPS REST API Delivery (Port 443) [Recommended]: Unlike traditional SMTP (ports 25, 465, 587) which is frequently blocked by corporate firewalls, hotel Wi-Fi, and residential Internet Service Providers (ISPs), neoMail can send emails via standard HTTPS on Port 443. Your emails will never be blocked by network filters.
  • High Deliverability & Tracking: SMTP2Go maintains top-tier sender reputation and SPF/DKIM authentication, ensuring your emails land directly in the Inbox rather than Spam. You receive an instant tracking ID for every sent message.
  • Hosted HTML Templates: Design responsive email templates in the SMTP2Go web builder and trigger them with dynamic JSON variables from VisualNEO Win.
  • Standard Authenticated SMTP (SSL/TLS): Also supports standard SMTP mail servers (Gmail, Outlook 365, Amazon SES, SendGrid, custom mail servers) with AUTH LOGIN and MIME multipart attachments.
  • Asynchronous Callbacks (No UI Freeze): Send emails with attachments in background threads while your VisualNEO UI stays 100% fluid, calling a NeoScript subroutine (Gosub) when delivery finishes.
  • In-Memory AES-256 Key Security: Protect your API keys and SMTP passwords in compiled .exe files from decompilation or hex viewers.

2. Quick Start: Send Your First Email in 3 Steps

Step 1: Configure Your SMTP2Go API Key

Set your API key (get one for free at smtp2go.com with 1,000 free emails/month) in your publication's startup code:

TEXT
neoMailSMTP2GoSetApiKey "api-YOUR_ACTUAL_SMTP2GO_API_KEY"

Step 2: Send an Email

Send a message with HTML formatting and an optional PDF invoice:

TEXT
neoMailSMTP2GoSend "support@yourcompany.com" "client@example.com" "Your Order #1042 is Confirmed!" "Thank you for your purchase." "<h1>Thank you!</h1><p>Your order #1042 has been shipped.</p>" "C:\Invoices\order1042.pdf" "" "" "[SentEmailId]" "[MailSuccess]"

Step 3: Check Success

TEXT
If "[MailSuccess]" "=" "True"
  AlertBox "Success" "Email sent successfully! (Tracking ID: [SentEmailId])"
Else
  AlertBox "Error" "Failed to send email: [MailError]"
EndIf

3. Asynchronous Email Sending with Callbacks

When sending large attachments (like multi-megabyte PDF catalogs or high-resolution images), uploads can take a few seconds depending on internet speed.

Using Asynchronous Actions, your VisualNEO application never freezes or shows "Not Responding". When delivery completes, neoMail automatically updates your variables and executes your designated NeoScript subroutine!

Asynchronous Example:

  1. Trigger Background Delivery:
TEXT
   SetVar "[StatusLabel]" "Sending email with attachments in background..."
   
   . Send async (calls subroutine 'OnInvoiceDelivered' when finished)
   neoMailSMTP2GoSendAsync "billing@mycompany.com" "[CustomerEmail]" "Invoice [InvoiceNumber]" "Here is your invoice." "<h2>Invoice [InvoiceNumber]</h2>" "[PubDir]invoices\[InvoiceNumber].pdf" "OnInvoiceDelivered" "[EmailId]" "[MailSuccess]"
  1. Define Your Subroutine (in Page Actions or Subroutines List):
TEXT
   :OnInvoiceDelivered
     If "[MailSuccess]" "=" "True"
       SetVar "[StatusLabel]" "Email sent! Tracking ID: [EmailId]"
       AlertBox "Delivery Success" "Your invoice has been delivered."
     Else
       SetVar "[StatusLabel]" "Failed to send email."
       AlertBox "Delivery Error" "Could not deliver email."
     EndIf
   Return

4. Using SMTP2Go Hosted Email Templates

If you have built beautiful HTML templates in the SMTP2Go web console, you can populate dynamic tags with a single JSON payload:

TEXT
. Prepare dynamic data
SetVar "[CustomerName]" "Alice Smith"
SetVar "[OrderTotal]" "$149.99"
SetVar "[JsonData]" "{"name":"[CustomerName]","total":"[OrderTotal]"}"

. Send using template ID 'order_confirmation_v2'
neoMailSMTP2GoSendTemplate "orders@mycompany.com" "alice@example.com" "order_confirmation_v2" "[JsonData]" "" "" "" "[SentEmailId]" "[MailSuccess]"

5. Standard SMTP Server Transport (Gmail, Outlook, Custom)

To send emails through a traditional SMTP server:

TEXT
. Configure SMTP connection (Host, Port, User, Password, Security, Timeout)
neoMailSMTPConfig "mail.smtp2go.com" "2525" "my-smtp-username" "my-smtp-password" "TLS" "60"

. Send email
neoMailSMTPSend "sender@domain.com" "Acme Sales" "buyer@domain.com" "Quote for Project" "Please find our quotation attached." "<h3>Project Quotation</h3>" "C:\Quotes\quote.pdf" "" "" "[SMTPSuccess]"

If "[SMTPSuccess]" "=" "True"
  AlertBox "Sent" "Message dispatched via standard SMTP server."
Else
  AlertBox "SMTP Error" "Log: [SMTPLog]"
EndIf

6. Securing Credentials (In-Memory AES-256)

To prevent your plain SMTP password or API key from being visible inside compiled .exe files:

  1. Encrypt your key once:
TEXT
   neoMailEncryptKey "api-my-real-secret-key" "MyPrivatePassword123" "[EncryptedKeyBase64]"
  1. Copy the resulting Base64 string into your project.
  2. In your production app, activate the key directly into RAM:
TEXT
   neoMailSetEncryptedApiKey "[EncryptedKeyBase64]" "MyPrivatePassword123"

7. Action Reference Table

SMTP2Go REST API Actions

ActionParametersDescription
neoMailSMTP2GoSetApiKey"[ApiKey]"Sets the plain SMTP2Go API key.
neoMailSMTP2GoSend"[From]" "[To]" "[Subject]" "[Text]" "[Html]" "[Attachments]" "[CC]" "[BCC]" "[VarEmailId]" "[VarSuccess]" "[VarError]"Sends an email with attachments via HTTPS REST API (Port 443).
neoMailSMTP2GoSendAsync"[From]" "[To]" "[Subject]" "[Text]" "[Html]" "[Attachments]" "[SubroutineName]" "[VarEmailId]" "[VarSuccess]"Sends email in background thread and calls NeoScript subroutine.
neoMailSMTP2GoSendTemplate"[From]" "[To]" "[TemplateId]" "[TemplateDataJson]" "[Attachments]" "[CC]" "[BCC]" "[VarEmailId]" "[VarSuccess]"Sends email based on an SMTP2Go hosted template.
neoMailSMTP2GoGetStats"[VarStatsJson]"Retrieves current delivery cycle statistics and quota in JSON.

Standard SMTP Actions

ActionParametersDescription
neoMailSMTPConfig"[Host]" "[Port]" "[Username]" "[Password]" "[Security]" "[TimeoutSec]"Configures custom SMTP server connection details.
neoMailSMTPSend"[FromEmail]" "[FromName]" "[ToEmail]" "[Subject]" "[Text]" "[Html]" "[Attachments]" "[CC]" "[BCC]" "[VarSuccess]" "[VarLog]"Sends email using standard socket SMTP protocol with AUTH LOGIN.

Security & Utilities

ActionParametersDescription
neoMailSetEncryptedApiKey"[Base64Cipher]" "[Password]"Decrypts API key or password into volatile RAM only.
neoMailEncryptKey"[PlainKey]" "[Password]" "[VarResult]"Encrypts a key into Base64 cipher text with AES-256.
neoMailSetTimeout"[TimeoutSeconds]"Sets connection and request timeout in seconds (default is 45).
neoMailIsBusy"[VarIsBusy]"Checks if a background email transmission is active (True/False).
neoMailCancel(none)Resets or cancels active background email requests.
neoMailValidateEmail"[Email]" "[VarIsValid]"Verifies syntax and domain formatting of an email address.
neoMailHtmlToText"[HtmlBody]" "[VarPlainText]"Converts HTML markup to clean, stripped plain text.