I would like to ask how to implement the automatic mail function in Delphi7 Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiNetwork/html/delphi_20061212105758143.html
I would like to ask how to implement the following functions in Delphi7:
The message sent by MessageBox is automatically sent to a recipient by email! TKs !!!
Idsmtp1.authenticationtype: = atnone;
Idsmtp1.connect;
Try if
Idsmtp1.authschemessupported. indexof ('login')>-1 then
Begin
Idsmtp1.authenticationtype: = atlogin;
Idsmtp1.authenticate;
End;
Idsmtp1.send (idmessage1 );
Finally
Idsmtp1.disconnect;
End;
Top.
Procedure tform1.sendemail (eaddress: string; scontent: string); // send mail
Begin
Try
Idsmtp1.host: = '192. 168.30.13 '; // SMTP server ksmail03 '192. 168.30.13'
Idsmtp1.port: = 25; // SMTP Port
Idsmtp1.username: = '';
Idsmtp1.password: = '';
Idsmtp1.connect ();
Except
Exit;
End;
Try
Idmessage1.body. Clear;
Idmessage1.body. Add (scontent); // content
Idmessage1.from. Text: = 'webapps @ codecomnic.com.cn '; // from
Idmessage1.recipients. emailaddresses: = trim (eaddress );
Idmessage1.subject: = 'do not swipe the card to remember the demo'; // Title
Idsmtp1.send (idmessage1 );
Finally
Idsmtp1.disconnect;
End;
End;
Idsmtp