En Büyük İslami Forum Sitesi

Programlama Dilleri => Delphi => Konuyu başlatan: administrator - Aralık 09, 2010, 12:48:23 ÖS

Başlık: Delphi de Microsot Outlook ile programdan mail gondermek
Gönderen: administrator - Aralık 09, 2010, 12:48:23 ÖS
uses
 comobj;

procedure SendMail(Recipients, Attachments: TStringList; Subject, Body: string);
const
 // OlItemType sabitleri
 // mail, not, kisi vs.
 olMailItem = 0;
 olAppointmentItem = 1;
 olContactItem = 2;
 olTaskItem  = 3;
 olJournalItem = 4;
 olNoteItem = 5;
 olPostItem = 6;
 // OlAttachmentType constants
 olByValue = 1;
 olByReference = 4;
 olEmbeddedItem = 5;
 olOLE = 6;

var
 myOlApp, myItem: OleVariant;
 i: integer;
begin
 myOlApp := CreateOLEObject('Outlook.Application');
 myItem := myOlApp.CreateItem(olMailItem);
 myItem.Subject := Subject;
 for i := 0 to Recipients.Count - 1 do
   myItem.Recipients.Add(Recipients);
 for i := 0 to Attachments.Count - 1 do
   myItem.Attachments.Add(Attachments, olByValue, 1, Attachments);
 myItem.Body := Body;
 myItem.Send;
 myOlApp := VarNull;
 myItem := VarNull;
end;

// kullanimi:
procedure TForm1.Button1Click(Sender: TObject);
var Alicilar, Dosyalar: TStringList;
begin
  Alicilar := TStringList.Create;
  Alicilar.Add('xxx@qqq.com');
  Alicilar.Add('qqq@mmm.com');
  Dosyalar := TStringList.Create;
  Dosyalar.Add('C:\autoexec.bat');
  Dosyalar.Add('C:\config.sys');
  try
    SendMail(Alicilar, Dosyalar, 'Deneme Mail, Autoexec.bat ve config.sys', Memo1.Lines.Text);
  finally
    Alicilar.Free;
    Dosyalar.Free;
  end;
end;
Başlık: Ynt: Delphi de Microsot Outlook ile programdan mail gondermek
Gönderen: Mooknutcha - Eylül 10, 2018, 09:35:12 ÖÖ
Read like I have felt that this is a very good thing because it is good content, useful.
Başlık: Ynt: Delphi de Microsot Outlook ile programdan mail gondermek
Gönderen: Treerapong - Ekim 02, 2018, 09:50:35 ÖÖ
Ich benutze diesen Code, es ist großartig.
Başlık: Ynt: Delphi de Microsot Outlook ile programdan mail gondermek
Gönderen: ambitious - Aralık 10, 2018, 10:25:28 ÖÖ
สมัคร Maxbet (https://scs168.com/maxbet/)sbobet (https://scs168.com/sbobet/)
Very useful info particularly the last part. I was seeking this certain information for a very long time. It is a very good article. Very helpful I'm having a problem with this. Thank you and best of luck.