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.
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!