Class SendMail (unit Inetmail)

Inherits from

TStarSocket

Constructors


constructor Create(AOwner: TComponent);



Functions

procedure AddAttachment(att: TSendMailAttachment);


procedure ClearAttachments;


destructor Destroy;


procedure LookupNameDone;


function RecommendEncodingMethod(filename: string): TMailEncoding;


procedure Base64Send(filename,Name,MimeType,Description,Disposition: string);


function CheckError: Boolean;


function CheckHeader(s: string): string;


function CheckHeaderString(s: string): string;


procedure CloseProc;


procedure DidConnect(Sender: TObject);

================== event handlers ====================================

procedure DoDisconnect(Sender:TObject);


procedure DoMailError(error: SendMailError; add: string);


procedure DoMailInfo(info: SendMailInfo; add: string);

================== core routines =====================

procedure DoRead(Sender:TObject);


procedure DoSendMail;


function EncodingNeeded(buf: PChar): Boolean;


function GetWinsockStarted: Boolean;


procedure IsAvailable(var Message: TMessage);


procedure MailAction(act: TMailAction);

=============== specific routines ============================

procedure NewLineRead(line: string);


procedure PlainSend(filename,Name,MimeType,Description,Disposition: string);


procedure QuotedSend(filename,Name,MimeType,Description,Disposition: string);


procedure QuotedSendBuffer(buf: PChar;size: LongInt);


procedure RawWrite(data: string);


function RecvText : string;

Someone made an invalid custom header!

procedure SetAttStrings(s:TStrings);


procedure SetBccStrings(s:TStrings);


procedure SetccStrings(s:TStrings);


procedure SetHeaderList(s:TStrings);


procedure SetMailStrings(s:TStrings);


procedure SetToStrings(s:TStrings);


procedure SetWinsockStarted(b: Boolean);


procedure SplitAddress(s: string;var address,name: string);


procedure TimedOut(Sender: TObject);


procedure UUEncode(buf: PChar;size: integer);


procedure UUEncodeSend(filename,Name,MimeType,Description,Disposition: string);


procedure Write(line: string);


procedure WriteBuffer(Buf: PChar;BufLen: integer);


Properties

property Action : TMailAction


property Attachments : TStrings


property FROM_Address : string


property FROM_Name : string


property Headers : TStrings


property KeepConnectionOpen : Boolean


property ListBcc : TStrings


property Listcc : TStrings


property ListTo : TStrings


property MailText : TStrings


property SMTP_Port : u_short


property SMTP_Server : string


property Subject : string


property TimeoutArp :


property TimeoutConnect :


property TO_Address : string


property TO_Name : string


property Version : string


property WinsockStarted : Boolean


property Error : SendMailError


property Success : Boolean


Events

event OnDone : TNotifyEvent


event OnFeedData : TSendMailEvent


event OnMailError : TSendMailErrorEvent


event OnMailInfo : TSendMailInfoEvent


Variables

Aborted : Boolean;


AttachStrings : TStrings;


AttNum : integer;


Atts : array[1..256] of TSendMailAttachmentPtr;


BccOffset : integer;


BccStrings : TStrings;


boundary : string;


Busy : Boolean;


ccOffset : integer;


ccStrings : TStrings;


ContinueFeeding : Boolean;


curqlen : integer;


current_list : integer;


dataline : integer;


datanum : integer;


datastep : integer;


DummyS : string;


FAction : TMailAction;


FDone : TNotifyEvent;


FeedLine : string;


FError : SendMailError;


FFeed : TSendMailEvent;


FFName : string;


FReply : string;


FSubject : string;


FSuccess : Boolean;


FTAddress : string;


FTName : string;


FVersion : string;


HeaderList : TStrings;


KeepOpen : Boolean;


lastaddress : string;


MailErrorEvt : TSendMailErrorEvent;


MailInfoEvt : TSendMailInfoEvent;


MailStrings : TStrings;


num_list : integer;


OnHold : Boolean;


PartialLine : string;


QuotedEncode : Boolean;


step : integer;


substep : integer;


ToOffset : integer;


ToStrings : TStrings;



Constructors


constructor Create(AOwner: TComponent);


Functions


procedure AddAttachment(att: TSendMailAttachment);


procedure ClearAttachments;


destructor Destroy;


procedure LookupNameDone;


function RecommendEncodingMethod(filename: string): TMailEncoding;


procedure Base64Send(filename,Name,MimeType,Description,Disposition: string);


function CheckError: Boolean;


function CheckHeader(s: string): string;


function CheckHeaderString(s: string): string;


procedure CloseProc;


procedure DidConnect(Sender: TObject);

================== event handlers ====================================


procedure DoDisconnect(Sender:TObject);


procedure DoMailError(error: SendMailError; add: string);


procedure DoMailInfo(info: SendMailInfo; add: string);

================== core routines =====================


procedure DoRead(Sender:TObject);


procedure DoSendMail;


function EncodingNeeded(buf: PChar): Boolean;


function GetWinsockStarted: Boolean;


procedure IsAvailable(var Message: TMessage);


procedure MailAction(act: TMailAction);

=============== specific routines ============================


procedure NewLineRead(line: string);


procedure PlainSend(filename,Name,MimeType,Description,Disposition: string);


procedure QuotedSend(filename,Name,MimeType,Description,Disposition: string);


procedure QuotedSendBuffer(buf: PChar;size: LongInt);


procedure RawWrite(data: string);


function RecvText : string;

Someone made an invalid custom header!


procedure SetAttStrings(s:TStrings);


procedure SetBccStrings(s:TStrings);


procedure SetccStrings(s:TStrings);


procedure SetHeaderList(s:TStrings);


procedure SetMailStrings(s:TStrings);


procedure SetToStrings(s:TStrings);


procedure SetWinsockStarted(b: Boolean);


procedure SplitAddress(s: string;var address,name: string);


procedure TimedOut(Sender: TObject);


procedure UUEncode(buf: PChar;size: integer);


procedure UUEncodeSend(filename,Name,MimeType,Description,Disposition: string);


procedure Write(line: string);


procedure WriteBuffer(Buf: PChar;BufLen: integer);


Properties


property Action : TMailAction


property Attachments : TStrings


property FROM_Address : string


property FROM_Name : string


property Headers : TStrings


property KeepConnectionOpen : Boolean


property ListBcc : TStrings


property Listcc : TStrings


property ListTo : TStrings


property MailText : TStrings


property SMTP_Port : u_short


property SMTP_Server : string


property Subject : string


property TimeoutArp :


property TimeoutConnect :


property TO_Address : string


property TO_Name : string


property Version : string


property WinsockStarted : Boolean


property Error : SendMailError


property Success : Boolean


Events


event OnDone : TNotifyEvent


event OnFeedData : TSendMailEvent


event OnMailError : TSendMailErrorEvent


event OnMailInfo : TSendMailInfoEvent


Variables


Aborted : Boolean;


AttachStrings : TStrings;


AttNum : integer;


Atts : array[1..256] of TSendMailAttachmentPtr;


BccOffset : integer;


BccStrings : TStrings;


boundary : string;


Busy : Boolean;


ccOffset : integer;


ccStrings : TStrings;


ContinueFeeding : Boolean;


curqlen : integer;


current_list : integer;


dataline : integer;


datanum : integer;


datastep : integer;


DummyS : string;


FAction : TMailAction;


FDone : TNotifyEvent;


FeedLine : string;


FError : SendMailError;


FFeed : TSendMailEvent;


FFName : string;


FReply : string;


FSubject : string;


FSuccess : Boolean;


FTAddress : string;


FTName : string;


FVersion : string;


HeaderList : TStrings;


KeepOpen : Boolean;


lastaddress : string;


MailErrorEvt : TSendMailErrorEvent;


MailInfoEvt : TSendMailInfoEvent;


MailStrings : TStrings;


num_list : integer;


OnHold : Boolean;


PartialLine : string;


QuotedEncode : Boolean;


step : integer;


substep : integer;


ToOffset : integer;


ToStrings : TStrings;