Subject: | Before or after |
Posted by: | Rhys Sage (abu…@127.0.0.1) |
Date: | Tue, 30 Dec 2003 |
I hav ethe following send routine. At the moment it either sends an
attachment or text. If I send both, should I put the attachment first or the
text first?
procedure TForm1.Button5Click(Sender: TObject);
begin
// set message headers
idMessage1.Clear;
idMessage1.From.Address := LabeledEdit1.Text;
idMessage1.Sender.Address := LabeledEdit1.Text;
idMessage1.Subject := LabeledEdit3.Text;
idMessage1.Organization := 'Some organisation';
idMessage1.Date := Date;
idMessage1.Recipients.EMailAddresses := LabeledEdit2.Text;
idMessage1.ReceiptRecipient.Address := LabeledEdit1.Text;
// add attachment if necessary
if LabeledEdit7.GetTextLen > 0 then
begin
with TIdText.Create(idMessage1.MessageParts) do
begin
Body.AddStrings(Memo1.Lines);
end;
with TIdAttachment.Create(idMessage1.MessageParts,
LabeledEdit7.Text) do
begin
ContentType := GetMIMETypeFromFile(LabeledEdit7.Text);
FileName := ExtractFileName(LabeledEdit7.Text);
end;
end
else
begin
idMessage1.Body.AddStrings(Memo1.Lines);
end;
idSMTP1.Send(idMessage1);
end;
--
Yours
Rhys
Join the anti-spam project:
http://groups.yahoo.com/group/Anti-Spam-Development/
or view my website:
http://www.sageworld.freeserve.co.uk