4D v15SMTP_QuickSend |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v15
SMTP_QuickSend
|
SMTP_QuickSend ( hostName ; msgFrom ; msgTo ; subject ; message {; sessionParam}{; port}{; userName ; password} ) -> Function result
|
||||||||||||||||||||||||||||||||||||||||||||||
Originally introduced in 4D v14 R5
The SMTP_QuickSend command now allows you to send messages with the Mime HTML format, with or without the SSL/TLS protocol. Mime HTML (.mht or .mhtml file extension) is a Web page archive format that can merge the HTML code as well as external resources such as images into a single document. It is supported by several browsers as well as MS Word, for example. Since this format is supported by 4D Write Pro areas, you will easily be able to save and send 4D Write Pro areas including all their resources by e-mail.
Pass 8 in sessionParam to format the message in Mime HTML and send it in standard mode.
Pass 9 in sessionParam to format the message in Mime HTML and send it in SSL/TLS mode.
These values correspond to usual combinations, however the sessionParam parameter is a actually a bit field and allows any custom combination if you use bitwise operators:
Bit number | Format used if bit is 1 |
0 | Use SSL or use default behavior, connect in clear, then upgrade to SSL if possible. |
1 | Never upgrade, stay in non-encrypted mode even if upgrade is possible. Bit is ignored if SSL (bit-0) is selected. |
2 | Message body is HTML; set the header accordingly. |
3 | MHTML message, bit-2 (HTML) is ignored. User is responsible to set everything up, except "To", "From", "Date", and "Subject" |
Note: This command does not support converted databases running in "Non-Unicode" mode.
You saved a .mht document on your disk and want to send it by e-mail. To do this, you can write:
$Message:=Document to text("c:\\documents\\invitation.mht")
$Host:="smtp.gmail.com"
$ToAddress:="john@4d.com"
$FromAddress:="harry@gmail.com"
$Subject:="Let's party"
$Param:=9 //MHTML with SSL
$Port:=465 //SSL port of gmail
$User:="harry@gmail.com"
$Password:="xyz&@!&@"
$Error:=SMTP_QuickSend($Host;$FromAddress;$ToAddress;$Subject;$Message;$Param;$Port;$User;$Password)
Produkt: 4D
Thema: 4D Internet Commands
4D v15 - Upgrade (Standard Edition) ( 4D v15)