//Mailbody ermitteln:
S := '';
S3 := LowerCase(Msg.ContentType);
if (S3 = 'text/plain') OR (S3 = 'text/
html') then begin
S := Msg.Body.Text;
end else begin
IsAlternative := ( S3 = 'multipart/alternative' );
for i := 0 to Msg.MessageParts.Count - 1 do begin
if (Msg.MessageParts.Items[i] is TIdText) then begin
if LowerCase(Msg.MessageParts.Items[i].ContentType) = 'multipart/alternative' then begin
isAlternative := true;
end else if LowerCase(Msg.MessageParts.Items[i].ContentType) = 'text/plain' then begin
if NOT isAlternative then
S := S + TIdText(Msg.MessageParts.Items[i]).Body.Text;
end else if LowerCase(Msg.MessageParts.Items[i].ContentType) = 'text/
html' then begin
S := S + TIdText(Msg.MessageParts.Items[i]).Body.Text;
end else begin
S := S + TIdText(Msg.MessageParts.Items[i]).Body.Text;
end;
end;
end;
end;