OutlookApplication1.Connect;
try
MailItem1 := OutlookApplication1.CreateItem(olMailItem) as _MailItem;
while toAdress <> '' do
begin
if Pos(';',toAdress) > 0 then
begin
MailItem1.Recipients.Add(Copy(toAdress,1,Pos(';',toAdress)-1));
Delete(toAdress,1,Pos(';',toAdress));
end
else
begin
MailItem1.Recipients.Add(toAdress);
toAdress := '';
end;
end;
MailItem1.CC := ToCC;
MailItem1.BCC := ToBCC;
MailItem1.Subject := Subject;
if EMailOutlookAbsender = '' then //local definitions?
begin
if Pos('@',getOptionMandantS('EMail_Absender','')) > 0 then
MailItem1.SendUsingAccount := OutlookApplication1.Session.Accounts.Item(getOptionMandantS('EMail_Absender',''));
end
else MailItem1.SendUsingAccount := OutlookApplication1.Session.Accounts.Item(EMailOutlookAbsender); //globale Einstellung
Mailitem1.BodyFormat := olFormatHTML;
//the default signature is added
ObjectInspector := Mailitem1.getinspector;
if ObjectInspector.EditorType = olEditorWord then
begin
WordEditor := ObjectInspector.WordEditor;
WordEditor.Characters.item(1).InsertBefore(Htmltext);
end
else
begin
Mailitem1.HtmlBody := StringReplace(Mailitem1.HtmlBody,'<body>','<body>'+Htmltext,[rfReplaceAll,rfIgnoreCase]);
end;
if AttachedFileNames <> nil then
begin
for i := 0 to AttachedFileNames.Count - 1 do
MailItem1.Attachments.Add(AttachedFileNames[i], EmptyParam, EmptyParam, EmptyParam);
end;
MailItem1.Display(true);
Any idea where the problem is? Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE