4D Internet Commands v12.1

SMTP_QuickSend

Home

 
4D Internet Commands v12.1
SMTP_QuickSend

 

SMTP_QuickSend 


 

SMTP_QuickSend ( hostName ; msgFrom ; msgTo ; subject ; message {; sessionParam} ) -> Function result 
Parameter Type   Description
hostName  String in Host name or IP address
msgFrom  Text in MailAddress or AddressList
msgTo  Text in MailAddress or AddressList
subject  Text in Subject
message  Text in Message
sessionParam  Longint in 1 = Use SSL, 0 or omitted = Do not use SSL
Function result  Integer in Error Code

The SMTP_QuickSend command gives the users the ability to build and send a mail message with one command. In the event that you require greater control over your message, or the message is of a more sophisticated nature, the group of SMTP commands based on the SMTP_New command should be utilized.

hostName is the host name or IP address of the SMTP server where the message will be sent for distribution.

msgFrom is a text value containing an AddressList of one or more complete mail addresses indicating who originally sent the message. All addresses listed in the From header are visible to the recipients of the message.

msgTo contains an AddressList value of one or more complete mail addresses. The addresses identified in the msgTo header will each be sent an original copy of the message. Each recipient of the message will see any other mail addresses the message was delivered to.

subject is a text value concisely describing the topic covered in detail by the message body.

Warning: Usually, the subject of the message should not contain characters with diacritical marks (such as é, ö, etc.). However, if you want to use such “extended” characters, refer to the SMTP_SetPrefs and SMTP_Charset command descriptions.

message is a text value containing the body of the mail message. For historical reasons, the size of the message is restricted to 32 KB.

The optional sessionParam parameter enables the SSL protocol for a connection:

  • If you pass 1, the message will be sent in SSL (synchronous mode),
  • If you pass 0 or omit this parameter, the message will be sent in standard, non-secure mode.

Example  

Here is an example of use of this command:

 $Host:="www.4d.com"
 $ToAddress:="adupont@4d.fr"
 $FromAddress:="jsmith@4d.com"
 $Subject:="Sales Report"
 $Message:="Can you send me the sales report for January 2009? Thanks."
 $Error:=SMTP_QuickSend($Host;$FromAddress;$ToAddress;$Subject;$Message;1)
 If($Error#0)
    ALERT("Error: SMTP_QuickSend"+Char(13)+IT_ErrorText($Error))
 End If

 
PROPERTIES 

Product: 4D Internet Commands
Theme: IC Send Mail
Number: 88992

 
HISTORY 

New
Modified: 4D Internet Commands v11
Modified: 4D Internet Commands v12.1

 
SEE ALSO 

SMTP_Charset
SMTP_New
SMTP_SetPrefs