Primero Gracias por tus respuestas, intente tu forma, otra que encontre parecida, me da siempre el mismo error. Si el outlook no esta abierto y minimizado me sale "El servidor no esta disponible" u "Operacion Anulada". Y no me deja hacer nada. Si tengo el outlook abierto funciona todo perfecto. Te muestro las forma que use.
Código Delphi
[-]
Outlook := TOutlookApplication.Create( nil );
try
Outlook.Connect;
try
olNameSpace := Outlook.GetNamespace('MAPI');
olNameSpace.Logon('', '', False, False);
try
MailIt := TMailItem.Create( nil );
MailIt.ConnectTo( Outlook.CreateItem( olMailItem ) as MailItem );
try
MailIt.Recipients.Add.........;
......................................
MailIt.Display;
finally
MailIt.Free;
end;
finally
MailIt.Free;
end;
finally
end;
finally
Outlook.free;
end;
o la forma del ejemplo del post 1-
Código Delphi
[-]
try
Outlook := GetActiveOleObject('Outlook.Application');
except
Outlook := CreateOleObject('Outlook.Application');
end;
MailItem := Outlook.CreateItem(olMailItem);
MailItem.Recipients.Add(...........
...............................
MailItem.Display;
Outlook := Unassigned;
end