# Unit smtpsend

Description | uses | Classes, Interfaces, Objects and Records | Functions and Procedures | Types | Constants | Variables

## Description

SMTP client

Used RFC: RFC-1869, RFC-1870, RFC-1893, RFC-2034, RFC-2104, RFC-2195, RFC-2487, RFC-2554, RFC-2821

## uses

- SysUtils
- Classes
- blcksock
- synautil
- synacode

## Overview

### Classes, Interfaces, Objects and Records

Name | Description
--- | ---
Class `TSMTPSend` | Implementation of SMTP and ESMTP procotol

### Functions and Procedures

`function SendToRaw(const MailFrom, MailTo, SMTPHost: string; const MailData: TStrings; const Username, Password: string): Boolean;`
`function SendTo(const MailFrom, MailTo, Subject, SMTPHost: string; const MailData: TStrings): Boolean;`
`function SendToEx(const MailFrom, MailTo, Subject, SMTPHost: string; const MailData: TStrings; const Username, Password: string): Boolean;`

### Constants

`cSmtpProtocol = '25';`

## Description

### Functions and Procedures

`function SendToRaw(const MailFrom, MailTo, SMTPHost: string; const MailData: TStrings; const Username, Password: string): Boolean;`

A very useful function and example of its use would be found in the TSMTPsend object. Send maildata (text of e-mail with all SMTP headers! For example when text of message is created by TMimeMess object) from "MailFrom" e-mail address to "MailTo" e-mail address (If you need more then one receiver, then separate their addresses by comma).

Function sends e-mail to a SMTP server defined in "SMTPhost" parameter. Username and password are used for authorization to the "SMTPhost". If you don't want authorization, set "Username" and "Password" to empty strings. If e-mail message is successfully sent, the result returns `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')

`function SendTo(const MailFrom, MailTo, Subject, SMTPHost: string; const MailData: TStrings): Boolean;`

A very useful function and example of its use would be found in the TSMTPsend object. Send "Maildata" (text of e-mail without any SMTP headers!) from "MailFrom" e-mail address to "MailTo" e-mail address with "Subject". (If you need more then one receiver, then separate their addresses by comma).

This function constructs all needed SMTP headers (with DATE header) and sends the e-mail to the SMTP server defined in the "SMTPhost" parameter. 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')

`function SendToEx(const MailFrom, MailTo, Subject, SMTPHost: string; const MailData: TStrings; const Username, Password: string): Boolean;`

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')

### Constants

`cSmtpProtocol = '25';`

Generated by PasDoc 0.9.0 on 2012-04-23 21:38:51