| 1 |
unit Unit10; |
| 2 |
|
| 3 |
interface |
| 4 |
|
| 5 |
uses |
| 6 |
Classes, SysUtils, IWAppForm, IWApplication, IWColor, IWTypes, Vcl.Controls, |
| 7 |
IWVCLBaseControl, IWBaseControl, IWBaseHTMLControl, IWControl, IWCompEdit, |
| 8 |
IWVCLComponent, IWBaseLayoutComponent, IWBaseContainerLayout, |
| 9 |
IWContainerLayout, IWTemplateProcessorHTML, IWCompButton, IWHTMLControls, |
| 10 |
System.Variants, |
| 11 |
IdIOHandler, IdIOHandlerSocket, IdIOHandlerStack, IdSSL, IdSSLOpenSSL, |
| 12 |
IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdMessage, |
| 13 |
IdExplicitTLSClientServerBase, IdMessageClient, IdSMTPBase, IdSMTP; |
| 14 |
|
| 15 |
type |
| 16 |
TIWForm10 = class(TIWAppForm) |
| 17 |
IWTemplateProcessorHTML1: TIWTemplateProcessorHTML; |
| 18 |
IWEdit1: TIWEdit; |
| 19 |
IWButton1: TIWButton; |
| 20 |
IWEdit2: TIWEdit; |
| 21 |
IWLink1: TIWLink; |
| 22 |
IdSMTP1: TIdSMTP; |
| 23 |
procedure IWButton1Click(Sender: TObject); |
| 24 |
procedure IWLink1Click(Sender: TObject); |
| 25 |
procedure IWAppFormCreate(Sender: TObject); |
| 26 |
public |
| 27 |
end; |
| 28 |
|
| 29 |
implementation |
| 30 |
|
| 31 |
{$R *.dfm} |
| 32 |
|
| 33 |
uses Unit3; |
| 34 |
|
| 35 |
procedure TIWForm10.IWAppFormCreate(Sender: TObject); |
| 36 |
begin |
| 37 |
with IdSMTP1 do |
| 38 |
begin |
| 39 |
Password := DM.FDTable3.FieldByName('MAILPASS').AsString; |
| 40 |
Username := DM.FDTable3.FieldByName('MAILUSER').AsString; |
| 41 |
Host := DM.FDTable3.FieldByName('HOST').AsString; |
| 42 |
end; |
| 43 |
end; |
| 44 |
|
| 45 |
procedure TIWForm10.IWButton1Click(Sender: TObject); |
| 46 |
var |
| 47 |
s: TIdMessage; |
| 48 |
begin |
| 49 |
if DM.FDTable1.Locate('EMAIL;BIRTH', VarArrayOf([IWEdit1.Text, IWEdit2.Text]), |
| 50 |
[]) = true then |
| 51 |
begin |
| 52 |
IdSMTP1.Connect; |
| 53 |
s := TIdMessage.Create(IdSMTP1); |
| 54 |
try |
| 55 |
s.ContentType := 'text/plain'; |
| 56 |
s.From.Name := DM.FDTable3.FieldByName('NAME').AsString + ' shop'; |
| 57 |
s.From.Address := '??shop@??.co.jp'; |
| 58 |
s.Recipients.EMailAddresses := DM.FDTable1.FieldByName('EMAIL').AsString; |
| 59 |
s.Subject := DM.FDTable3.FieldByName('NAME').AsString + |
| 60 |
' shop password user ' + DM.FDTable1.FieldByName('NAME').AsString; |
| 61 |
s.Body.Text := 'site password:' + DM.FDTable1.FieldByName |
| 62 |
('PASSWORD').AsString; |
| 63 |
finally |
| 64 |
s.Free; |
| 65 |
end; |
| 66 |
IdSMTP1.Disconnect; |
| 67 |
WebApplication.ShowMessage('���M��������'); |
| 68 |
end |
| 69 |
else |
| 70 |
WebApplication.ShowMessage('�o�^��������������'); |
| 71 |
end; |
| 72 |
|
| 73 |
procedure TIWForm10.IWLink1Click(Sender: TObject); |
| 74 |
begin |
| 75 |
Release; |
| 76 |
end; |
| 77 |
|
| 78 |
end. |