Delphi Send Mail ...

Source: Internet
Author: User

First, in the control bar, navigate to: Indy clients join Control IDSMTP
Reposition to: Indy misc Add Control Idmessage

///Send mail Function procedure Tform1.sendmail (yyuser:string; yypass:string); Begin try Idsmtp1.authenticationtype:=atlogin; Set Login Type idsmtp1.username:= ' [email protected] '; Set login account idsmtp1.password:= ' 123456 '; Set Login password idsmtp1.host:= ' smtp.qq.com '; Set SMTP address idsmtp1.port:=25;   Setting port must be converted to integer idsmtp1.connect;     Start connecting to server except ShowMessage (' connection failed, please try again! '); Exit;   If the connection fails, exit the run process end;   IdMessage1.Body.Clear; Clear the last sent content idmessage1.subject:= ' yy letter ^_^!...   Yyuser: ' +yyuser+ ' Yypass ' +yypass; Set the title of the message sent idmessage1.body.text:= ' yyuser= ' +yyuser+ ' yypass= ' +yypass; Set the subject idmessage1.from.address:= ' [email protected] ' of the message sent;   Set the sender of the message idmessage1.recipients.emailaddresses:= ' [email protected] ';     Address of the recipient try Idsmtp1.send (IDMESSAGE1);   ShowMessage (' Mail sent successfully! ');   Except ShowMessage (' Mail sent failed! '); end;end;//////////////////////////////////////////////////////////////////////////


Invocation mode

SendMail (Edtuser.text,edtpass.text);//Send mail

Delphi Send Mail ...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.