I see online said a post by IdSMTP1, IdMessage1 the two control can be achieved, and sincerely thank!!!!!!
CodePudding user response:
Pro measuring success
Try
{
IdSMTP1 - & gt; The Host="stmp.126.com";//your email server
IdSMTP1 - & gt; The Username="Username".//your email user name
IdSMTP1 - & gt; Password="Password";//your password
IdSMTP1 - & gt; The Connect ().
IdMessage1 - & gt; The Clear ();
IdMessage1 - & gt; The From - & gt; Address="[email protected]";//your email
IdMessage1 - & gt; Recipients - & gt; EMailAddresses="[email protected]".//here to change your destination mailbox
IdMessage1 - & gt; Body - & gt; Add (" This is the first line. ");
IdMessage1 - & gt; Body - & gt; Add (" This is the second line. ");
IdMessage1 - & gt; Subject="This is Only a Test";
IdSMTP1 - & gt; Send (IdMessage1);
}
The catch (Exception& E)
{
MessageBox (0, L "test", e.M essage. C_str (), MB_OK);
}
CodePudding user response:
Thank you, thank you sincerely!!!!!!!!!!