//MUTLAKA OKUYUN!!!
//forma IDMessage bileşenini ve IDSmtp bileşenini yerleştirin.
//ayrıca bir checkbox ve bir buton ve edit bileşeninden 6 tane memo bileşeninden 1 tane
//forma koyun. Check box E-mail suncusuna Login'in zorunlu olmasının seçilmesini sağlıyor.
//genellikle hepsinde zorunlu
procedure TForm1.Button2Click(Sender: TObject);
begin
IdSMTP1.Host :=edit1.Text;
IdSMTP1.UserId :=Edit2.Text;
IdSMTP1.Password :=Edit3.Text;
if CheckBox1.Checked then
IdSMTP1.AuthenticationType:=atLogin
else
IdSMTP1.AuthenticationType:=atNone;
try
IdSMTP1.Connect;
except
ShowMessage('Bağlantı Sağlanamadı. Mail sunucusunun doğruluğundan emin olun.');
end;
IdMessage1.From.Address :=edit4.Text;
IdMessage1.Recipients.EMailAddresses:=edit5.Text;
IdMessage1.Subject :=edit6.Text;
IdMessage1.Body.Assign(Memo1.Lines);
try
IdSMTP1.Send(IdMessage1);
ShowMessage('Mail Gönderildi.');
finally
IdSMTP1.Disconnect;
end;
end;