HTML attachments, plain text body, '550 Administrative prohibition' error with M

Giganews Newsgroups
Subject: HTML attachments, plain text body, '550 Administrative prohibition' error with M
Posted by:  Michael J. Leaver (spam@mjleaver.com)
Date: Sun, 26 Jun 2005

Is the following (code fragment) the correct way to send an email that
has a plain text message body, with one or more HTML files as attachments:

SMTPMsg:=TIdMessage.Create(nil);
SMTPMsg.Clear;
SMTPMsg.ContentType:='text/plain';
SMTPMsg.Body.Add('blah');
...
SMTPMsg.AttachmentEncoding := 'MIME';
SMTPMsg.ContentType := 'multipart/mixed';
SMTPMsg.Encoding := meMIME;
SMTPMsg.NoEncode := FALSE;
SMTPMsg.NoDecode := FALSE;
SMTPMsg.IsEncoded := TRUE;

// Attach one or more HTML files
with TIdWideAttachmentFile.Create(SMTPMsg.MessageParts, AFilename) do begin
  ContentType:=GetMIMETypeFromFile(AFilename);
  Filename:=WideExtractFilename(AFilename);
end;

I've skipped the bits that set the subject, to, from, etc.

I'm interested in knowing if this is the correct method as I'm having
problems with the McAfee outbound email virus scanner (it gives a '550
Administrative prohibition' error). If I switch off the outbound email
scanner, there is no problem. Also, sending the sames files via Outlook
Express, with the outbound email scanner enabled, does not produce this
error.

Thanks

Replies