|Subject:||SMTP mail server not forwarding attachment to recipients if more than one|
|Posted by:||Codeman II (thegentlem…@webmail.co.za)|
|Date:||Tue, 10 Jan 2006|
I am using Indy 9 (latest version) with Delphi 7.
I have an SMTP server application that receives all outgoing emails and log
them in a database whereafter I sent the
message to its destination(s).
Everything is working fine but when I include more than one email address in
the To: field of my email client, only the
first email are sent WITH the attachments (when attachments have been
added). All the rest of the emails are sent with the subject and body text
but no attachments. For example if I sent an email with attachments to:
1…@mail.com;2…@mail.com;3…@mail.com the 1…@mail.com email address
email with it attachments but the other email address' receive the email but
without any attachments.
I am using the idSMTPServer component and here is my code for the
X, MailOutID :Integer;
// This is the main event if you have opted to have the idSMTPServer to do
your parsing for you.
// The AMessage contains the completed TIdMessage.
// NOTE: Dont forget to add IdMessage to your USES clause!
OkSave := True;
lblTo.Caption := AMsg.Recipients.EMailAddresses;
lblFrom.Caption := AMsg.From.Text;
lblSubject.Caption := AMsg.Subject;
If AMsg.MessageParts.TextPartCount > 0 then
memBody.Lines := AMsg.Body;
// Implement your file system here :)
idSMTP.Host := 'smtp.saix.net';
idSMTP.Port := 25;
MessageDLG('An error occurred: ' + IntToStr(GetLastError) + '.',
mtError, [mbOk], 0);
OkSave := False;
-----------CODE END --------------