| 6 |
Classes, SysUtils, IWAppForm, IWApplication, IWColor, IWTypes, Vcl.Controls, |
Classes, SysUtils, IWAppForm, IWApplication, IWColor, IWTypes, Vcl.Controls, |
| 7 |
IWVCLBaseControl, IWBaseControl, IWBaseHTMLControl, IWControl, IWCompEdit, |
IWVCLBaseControl, IWBaseControl, IWBaseHTMLControl, IWControl, IWCompEdit, |
| 8 |
IWVCLComponent, IWBaseLayoutComponent, IWBaseContainerLayout, |
IWVCLComponent, IWBaseLayoutComponent, IWBaseContainerLayout, |
| 9 |
IWContainerLayout, IWTemplateProcessorHTML, IWCompButton, IWHTMLControls, System.Variants; |
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 |
type |
| 16 |
TIWForm10 = class(TIWAppForm) |
TIWForm10 = class(TIWAppForm) |
| 19 |
IWButton1: TIWButton; |
IWButton1: TIWButton; |
| 20 |
IWEdit2: TIWEdit; |
IWEdit2: TIWEdit; |
| 21 |
IWLink1: TIWLink; |
IWLink1: TIWLink; |
| 22 |
|
IdSMTP1: TIdSMTP; |
| 23 |
procedure IWButton1Click(Sender: TObject); |
procedure IWButton1Click(Sender: TObject); |
| 24 |
procedure IWLink1Click(Sender: TObject); |
procedure IWLink1Click(Sender: TObject); |
| 25 |
|
procedure IWAppFormCreate(Sender: TObject); |
| 26 |
public |
public |
| 27 |
end; |
end; |
| 28 |
|
|
| 32 |
|
|
| 33 |
uses Unit3; |
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); |
procedure TIWForm10.IWButton1Click(Sender: TObject); |
| 46 |
|
var |
| 47 |
|
s: TIdMessage; |
| 48 |
begin |
begin |
| 49 |
if DM.FDTable1.Locate('EMAIL;BIRTH',VarArrayOf([IWEdit1.Text,IWEdit2.Text]),[]) = true then |
if DM.FDTable1.Locate('EMAIL;BIRTH', VarArrayOf([IWEdit1.Text, IWEdit2.Text]), |
| 50 |
|
[]) = true then |
| 51 |
begin |
begin |
| 52 |
//send email |
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('送信しました'); |
WebApplication.ShowMessage('送信しました'); |
| 68 |
end |
end |
| 69 |
else |
else |