Navigation:  ThinBASIC Modules > SMTP >

SMTP_SendEmail

Previous pageReturn to chapter overviewNext page

 

Description

 

Send email once a connection has been made to your SMTP server after calling SMTP_Connect.

 

Syntax

 

ErrorCode = SMTP_SendEmail( To, Cc, BCc, Subject, Message, Attach, Options )

 

Returns

 

Number.

If ErrorCode < 0 (Zero) means failure. Use SMTP_GetError to return error description of error code.

 

Parameters

 

Name

Type

Optional

Meaning

To

String

No

Recipient, separated by semi-colons

Cc

String

No

CC list, separated by semi-colons

BCc

String

No

BCC list, separated by semi-colons

Subject

String

No

Subject text (max 256 chars)

Message

String

No

Mail message content or message filename from which to load message content.

 
If the first character of the message is a '@', then it is considered as the filename which contains the message to send.

Example: "@C:\Temp\Message.txt"

Attach

String

No

File attachment list.

It may contain one or more attachments, separated by semi-colons, with no embedded spaces. If the function

  SMTP_SetOption(%SMTP_ENABLE_IMAGE, 1)

has been called previously, attachment files ending with ".GIF", ".BMP", or ".TIF" are attached as image types rather than regular images.  This allows some email clients to display the images.

Options

Numeric

No

Not used but mandatory. Just enter zero

 

Remarks

 

Note that all email addresses (in To, CC, and BCC strings) must be bracketed, and the CC and BCC strings may contain multiple email addresses, separated by semi-colons. .

 

Restrictions

 

Message maximum size it 32000 bytes. If more room is needed, consider using external file message option.

 

See also

 

Examples