Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TForm1.WorkIt(Sender: TObject);
- var logfile: TStringList;
- i: Integer;
- begin
- IdSMTP1 := TIdSMTP.Create(nil);
- IdMessage1 := TIdMessage.Create(nil);
- Screen.Cursor := crHourGlass;
- RichEdit2.Text:=RichEdit1.Text;
- try
- IdSMTP1.HeloName := 'blabla';
- IdSMTP1.Host := Form3.Edit1.Text;
- IdSMTP1.Username := Form3.Edit4.Text;
- IdSMTP1.Password := Form3.Edit5.Text;
- IdSMTP1.Port := StrToInt(Form3.Edit2.Text);
- IdSMTP1.AuthenticationType:=atLogin;
- IdSMTP1.Connect;
- IdMessage1.From.Address := 'blabla';
- IdMessage1.Recipients.EMailAddresses := StatusBar1.Panels[1].Text;
- IdMessage1.ReceiptRecipient.Address := 'blabla';
- IdMessage1.Subject := Form3.Edit6.Text;
- for i:=0 to RichEdit1.Lines.Count-1 do
- begin
- IdMessage1.Body.Add(RichEdit2.Lines.Strings[i]);
- end;
- IdSMTP1.Send(IdMessage1);
- finally
- FreeAndNil(IdSMTP1);
- FreeAndNil(IdMessage1);
- Screen.Cursor := crDefault;
- end;
- end;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement