Home > Back-end >  Indy10 CB6 send mail
Indy10 CB6 send mail

Time:09-25

To help you, I want to learn with indy send mail, get along while also didn't succeed, can you give me a simple email code,
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!!!!!!!!!!
  • Related