LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

smtp authentication

Solved!
Go to solution

Hello, please  help me, when I use System_Net_Mail_SmtpClient_Send_1(smtpClient, message, NULL) ,I get always the -6571 error  and I don't understand  the problem 

0 Kudos
Message 21 of 24
(1,389 Views)

I have the same problem System_Net_Mail_SmtpClient_Send return -6571 and does't work.

My code is:

 

Initialize_System ();

ret=System_Net_Mail_SmtpClient__Create_2 (&SmtpClient, "smtp.gmail.com", 587, 0);
ret=System_Net_Mail_SmtpClient_Set_EnableSsl(SmtpClient, 1, 0);
ret=System_Net_Mail_SmtpClient_Set_DeliveryMethod(SmtpClient, 0, 0);
ret=System_Net_Mail_SmtpClient_Set_Timeout(SmtpClient, 5000, NULL);
ret=System_Net_Mail_SmtpClient_Set_UseDefaultCredentials(SmtpClient, 0, 0);
ret=System_Net_NetworkCredential__Create_1(&NetworkCredential, "****from****@gmail.com", "*********", 0);
ret=System_Net_Mail_SmtpClient_Set_Credentials(SmtpClient,(System_Net_ICredentialsByHost)NetworkCredential, NULL);
ret=System_Net_Mail_SmtpClient_Send(SmtpClient, "****from****@gmail.com", "****to****@yahoo.com.ar", "Mail de prueba","Hola Mundo", NULL);

Close_System();

 

Please Help Me.

Regards



0 Kudos
Message 22 of 24
(1,283 Views)

I was able to do it, i can send emails. The problem wasn't the code. The problem was that gmail blocked the access to the account. Google sent me an email to let me know that the account was blocked: 

 

Revisión de un intento de acceso bloqueado

I got this link in the email:

permite el acceso a apps menos seguras

When I set the access to "active" it began to work.

Message 23 of 24
(1,280 Views)

Hi Jimmy,

 

I am trying a similar application to send email via SMTP server. Would you be kind enough to share the project files so that I can try on my email?

 

Thank you 🙂

0 Kudos
Message 24 of 24
(293 Views)