Einzelnen Beitrag anzeigen

easywk

Registriert seit: 9. Jul 2003
Ort: Schwanewede
117 Beiträge
 
Delphi 7 Enterprise
 
#1

Indy Smtp: Empfänger mit MAC sehen Attachment nicht

  Alt 19. Feb 2011, 17:18
Hallo zusammen,

ich habe ein kleineres Problem mit dem Senden von Mails via Indy Smtp. Verwendet der Mail-Empfänger einen Windows-Rechner und Outlook oder Thunderbird als Mailclient, ist alles gut. Bei Mail-Empfängern mit Mac sind die Attachments aber nicht sichtbar. Mir wird berichtet, dass die Attachments zwar da sind, aber nicht angezeigt werden. Hier mal mein Quellcode:
Delphi-Quellcode:
  
  // Smtp konfigurieren
  Smtp.Username:=ReadString('EMail','Username','');
  Smtp.Password:=DecodePassword(ReadString('EMail','Pwd',''));
  Smtp.Host:=Trim(ReadString('EMail','Host',''));
  Smtp.Port:=ReadInteger('EMail','Port',0);
  Smtp.UseTLS:=utNoTLSSupport;
  // Auth-Typ setzen
  if length(Smtp.Username)=0 then
    Smtp.AuthType:=satNONE
  else Smtp.AuthType:=satDEFAULT;
  // E-Mail konfigurieren
  Screen.Cursor:=crHourGlass;
  with IdMsgSend do
    begin
      From.Text:=EditAbsender.Text;
      Subject:=EditBetreff.Text;
    end;
  // Textteil
  IdMsgSend.MessageParts.Clear;
  with TIdText.Create(IdMsgSend.MessageParts)do
    begin
      ContentType:='text/plain';
      CharSet:='ISO-8859-1';
      ContentTransfer:='base64';
      Body.Text:=Mailtext.Lines.Text; // Text aus Memo übernehmen
    end;
  IdMsgSend.ContentType := 'multipart/related; type="text/plain"';
  IdMsgSend.CharSet :='ISO-8859-1';
  // Alle Dateien aus der Liste als Attachment einfügen
  for cnt:=0 to ListAnhang.Items.Count-1 do
    if FileExists(ListAnhang.Items[cnt]) then
      TIdAttachmentFile.Create(IdMsgSend.MessageParts,ListAnhang.Items[cnt]);
  // Verbindung zum SMTP-Server aufbauen
  Smtp.Connect;
  Smtp.Send(IdMsgSend);
  Smtp.Disconnect;
Smtp und IdMsgSend sind auf dem Formular angelegt:
Delphi-Quellcode:
  
  object Smtp: TIdSMTP
    OnWork = SmtpWork
    OnWorkBegin = SmtpWorkBegin
    OnWorkEnd = SmtpWorkEnd
    MailAgent = 'Thunderbird 2.0.0.9 (Windows/20071031)'
    Port = 0
    SASLMechanisms = <>
    Left = 208
    Top = 223
  end

  object IdMsgSend: TIdMessage
    AttachmentEncoding = 'MIME'
    BccList = <>
    CharSet = 'ISO-8859-1'
    CCList = <>
    ContentType = 'multipart/related'
    Encoding = meMIME
    FromList = <
      item
      end>
    Recipients = <>
    ReplyTo = <>
    ConvertPreamble = True
    Left = 235
    Top = 223
  end

  object IdAntiFreeze: TIdAntiFreeze
    Left = 264
    Top = 224
  end
Ich verwendet Delphi7 und Indy10.

Jemand eine Idee, was ich falsch mache?

easy
Björn
if all else fails - read the instructions
  Mit Zitat antworten Zitat