4D Blog

Home Product Easily send a 4D Write Pro document containing images as the body of an email!

Easily send a 4D Write Pro document containing images as the body of an email!

November 26, 2019

Product

Want to use 4D Write Pro to create HTML emails with static pictures in the text? Maybe something like a fancy newsletter with pictures of the top ten destinations in the world, or simply include your company logo? Wondering how to accomplish this? Wonder no more because with the 4D v18, you can in three simple steps:

  • Export your 4D Write Pro document in MIME format,
  • use the MAIL Convert from MIME command to transform the MIME into an email object,
  • then send it via the SMTP New transporter command.

HDI 4D Write Pro to HTML body

Here’s an example using a MIME created from a 4D Write Pro document:


// Mime export 

WP EXPORT VARIABLE(WParea;$mime;wk mime html)
 
// conversion of Write Pro document Mime in mail object
$email:=MAIL Convert from MIME($mime)
 
// Fill your mail object headers
$email.subject:="4D Write Pro HTML body"
$email.from:="YourEmail@mail.com"
$email.to:="RecipientEmail@mail.com"
 
$yourServerInfo:=New object
$yourServerInfo.host:="your.smtp.com"
$transporter:=SMTP New transporter($yourServerInfo)
$status:=$transporter.send($email)

Piece of cake! Try the HDI above to see the new feature in action, and take check out the doc center for more examples!

 

Discuss

Tags 4D Write Pro, Mail, SMTP, v18

Latest related posts

  • October 23, 2025

    Starting Qodly studio is just two clicks away

  • October 22, 2025

    Localize your Qodly Pages: A Practical Guide

  • October 21, 2025

    New Way to Control Your HTTP Responses

Fabrice Mainguené
Fabrice Mainguené
• Product Owner •Fabrice Mainguené joined 4D Program team in November, 2016. As a Product Owner, he is in charge of writing the user stories then translating it to functional specifications. His role is also to make sure that the feature implementation delivered is meeting the customer need.After obtaining a Bachelor degree in Computer Science at CNAM, Fabrice joined a small software publishing company as a Windev developer. Then he worked for different companies in industry and trade areas as a Windev and web developer as well as technical advisor on new features.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • AI
  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor
Subscribe to 4D Newsletter

© 2025 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy