SendToEx function
function SendToEx(Const MailFrom, MailTo, Subject, SMTPHost: string; Const MailData: Tstrings; Const Username, Password: string): Boolean;
Unit
SMTPsend
Description
A very useful function and example of its use would be found in the TSMTPsend object. Sends "MailData" (text of e-mail without any SMTP headers!) from "MailFrom" e-mail address to "MailTo" e-mail address (If you need more then one receiver, then separate their addresses by comma).
This function sends the e-mail to the SMTP server defined in the "SMTPhost" parameter. Username and password are used for authorization to the "SMTPhost". If you dont want authorization, set "Username" and "Password" to empty strings. If the e-mail message is successfully sent, the result will be TRUE.
If you need use different port number then standard, then add this port number to SMTPhost after colon. (i.e. '127.0.0.1:1025')