Strange message when tidsmtp sends an email!

Source: Internet
Author: User
Strange message when tidsmtp sends an email! Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiNetwork/html/delphi_20061214202002126.html
I used Indy's tidsmtp and tidmessage to send an email, but the bad secquence of command error occurred! My Code Yes:
Procedure tfrmemail. speedbutton7click (Sender: tobject );
VaR MSG: tidmessage;
Begin
MSG: = tidmessage. Create (SMTP );
MSG. Clear;
MSG. Subject: = edtsubject. Text; // subject topic
MSG. Body. Assign (memobody. lines); // body content
MSG. From. Text: = trim (edtfrom. Text); // sender
MSG. Recipients. emailaddresses: = trim (edtmailto. Text); // recipient
SMTP. HOST: = 'smtp .163.com ';
SMTP. authenticationtype: = atlogin;
SMTP. Username: = 'xaguobo ';
SMTP. Password: = '********'; // here, I entered the login password for my 163 mailbox.
SMTP. Port: = 25;
Try
SMTP. Connect (-1); // I tracked the connection to the server
Try
SMTP. Send (MSG );
Showmessage ('email sent ');
Finally
SMTP. Disconnect;
End;
Except
On E: exception do
Showmessage ('mail failed message: '+ E. Message );

End;

End;

Please advise me!

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.