Home > Back-end >  [for], Delphi how to send and receive text in English, online, etc...
[for], Delphi how to send and receive text in English, online, etc...

Time:10-02

Online most of the information is sent in Chinese, it is said that English is very simple, but I don't know what this aspect, to look for a long time did not find information,
Environment, Delphi 7, GSM modem, sim908,
Not directly address, give me some simple and practical data

CodePudding user response:

Up,,,,,,,,,,,,,,,,

CodePudding user response:

Search for "the AT command", use very relevant information,,

CodePudding user response:

Text code:
 procedure TEMailFrm. MailSend; 
Var TM: TIdMessage;
S1, S2, S3: string;
The begin
If Edit25. Text="' then
The begin
Showmessage (' please enter the password! ');
The exit;
The end;
The List: a List=+ 1;
Statusbar1. Panels [0]. Text:='is sending mail... ';
TM:=TIDMEssage. Create (nil);
Do With TM
The begin
Body. The Assign (Memo22. Lines);
//From the address:=Combobox25. Text;//the sender address
From the address:=Combobox23. Text;//the sender address
Recipients. EMailAddresses:=Combobox28. Text;//the recipient address, to your EMAIL address here
Subject:=Combobox29. Text;//email title
//Priority:=mphigh;//priority, mphigh is the highest,
Priority:=TIDMessagePriority (Combobox26. ItemIndex);
If Edit21. Text<> "' then//attachment 1
If FileExists (Edit21. Text) then
TIdAttachment. Create (MessageParts, Edit21. Text);
Edit22. Text:=Trim (Edit22. Text);//in annex 2
If Edit22. Text<> "' then
If FileExists (Edit22. Text) then
TIdAttachment. Create (MessageParts, Edit22. Text);
Edit23. Text:=Trim (Edit23. Text);//attachment 3
If Edit23. Text<> "' then
If FileExists (Edit23. Text) then
TIdAttachment. Create (MessageParts, Edit23. Text);
The end;
Case Combobox27. ItemIndex of
0: IdSMTP1. AuthenticationType:=atLogin;//need certification
1: IdSMTP1. AuthenticationType:=atNone;//without certification
The end;
IdSMTP1. Username:=Combobox23. Text;//the server user name
IdSMTP1. Password:=Edit25. Text;//server password
IdSMTP1. Host:=Combobox21. Text;//SMTP server address
IdSMTP1. Port:=StrToInt (Combobox22. Text);//server port
Try
IdSMTP1. Connect;
Except,
Statusbar1. Panels [0]. Text:=IntToStr (List) + ', unable to connect to the server! ';
The exit;
The end;
Try
IdSMTP1. Send (TM);
Except,
IdSMTP1. Disconnect;
S1:=IntToStr (List) + ', send failed! ';
Memo21. Lines. The Add (S1);
The exit;
The end;
IdSMTP1. Disconnect;
S1:=IntToStr (List) + ', send success: '+ Combobox28. Text +' "' + Combobox29. Text + '"';
Memo21. Lines. The Add (S1);
Statusbar1. Panels [0]. Text:="' + S1 + S2 + S3;
The end;

CodePudding user response:

Be free to try,
Mark
SMS is a concept with mail?
Like,