version 6.5
SMTP_Send (smtp_ID) Integer
Parameter | Type | Description | |
smtp_ID | Longint | Message reference | |
Function result | Integer | Error Code |
Description
The SMTP_Send command sends the message referenced by smtp_ID but does not clear the data from memory.
smtp_ID is the long integer reference to the mail message created with the SMTP_New command.
Example
In this example a message is created and the static elements are defined outside the scope of the 'for' loop. Then, for each record in the [People] table, the message is customized and sent.
$error:=SMTP_New ($smtp_id) $error:=SMTP_Host ($smtp_id;"wkrp.com") $error:=SMTP_From ($smtp_id;"herb_tarlick@wkrp.com") $error:=SMTP_ReplyTo ($smtp_id;"bigguy@wkrp.com") $error:=SMTP_Subject ($smtp_id;"Discounts on Ad Space!") FIRST RECORD([People]) For($i;1;Records in Selection([People])) If ([People]Sales2Date>100000) $Body:=<>BigDiscText Else $Body:=<>SmlDiscText End if $Body:=Replace String ($BoilerPlate;"<Salutation>";[People]Firstname) $error:=SMTP_To ($smtp_id;[People]Email;1) `Replace the "To" header with new value $error:=SMTP_Body ($smtp_id;$Body) $error:=SMTP_Send ($smtp_id) NEXT RECORD([People]) End for $error:=SMTP_Clear ($smtp_id)
See Also