06-22-2015 11:41 PM - edited 06-22-2015 11:43 PM
Hi,
I'm trying to send email via this program ( as attached ) with gmail, i tried using 2 ports ( port 485 and port 587 ) and both showed me errors.
Port 485 's error shows : System.Net.Sockets.SocketException
Port 587 's error shows : System.Net.Mail.SmtpException
i have also attached screenshot of both errors below.
Any help is greatly appreciated !
*I'm using NI LabVIEW 2013 SP1 (32-bit)
Solved! Go to Solution.
06-22-2015 11:55 PM
Unfortunately I am on 2012 so I can't actually see your code, but from the errors it seems that your connection is not working properly, do you have SSL enabled in your connection setup?
Port 587 is the accepted port for gmail using SSL, 485 has been discontinued to the best of my knowledge as all email access for Gmail now needs to go through SSL communications.
Just in case you want to test with another email sending program that definitely works I have attached the version of Gmail email code that I used successfully last week. The SMTP settings etc are all correct you will just need to fill out the email user details.
06-23-2015 12:06 AM - edited 06-23-2015 12:11 AM
Hi ogk,
thanks for the reply,
I tried using your program but there's an error showing :
Invoke Node Error calling method System.Net.Mail.SmtpClient.Send, (System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
Inner Exception: System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at) <append><b>System.Net.Mail.SmtpException</b> in Email.vi
Is it possible that there's problem with my network connections? As i'm currently using my school's computer connected directly to my phone's personal hotspot
Edit : When i opened the program it says that .NET assembly changed ( attached screenshot )
06-23-2015 02:52 AM
Found out what was the problem....the gmail account has to change the security settings to allow 3rd party device to log in.
Problem solved!
08-10-2015 01:30 PM
That's excellent you found a fix for this, I'm having similar issues.
Where did you find the security settings that needed to be adjusted?
Thanks in advance!
Winston
02-09-2016 04:46 PM
Here is where you allow "less secure apps"
01-30-2017 12:51 PM
I also am having difficulty using this. The error message that I get is:
Invoke Node Error calling method System.Net.Mail.SmtpClient.Send, (System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
Inner Exception: System.Net.Mail.SmtpException: Failure sending mail.
Inner Exception: System.Net.WebException: Unable to connect to the remote server
Inner Exception: System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 74.125.70.108:587) <append><b>System.Net.Sockets.SocketException</b> in Email.vi
I have allow less secure apps in Gmail set to on.
01-30-2017 02:04 PM - edited 01-30-2017 02:04 PM
I just tested the sample VI and it works fine when I changed "Turn on less secure apps".
https://www.google.com/settings/u/0/security/lesssecureapps
I turned it off and immediately got the same error you reported.
01-30-2017 02:07 PM
I remember having difficulties with this. Here is a screenshot of how I'm using the LabVIEWSMTPClient.lvlib. You must wire a True constant to "use TLS" Hope this helps!
08-30-2017 09:51 AM
Same problem with me...
I asked the IT service (university proxy) and ports 465 and 587 are open.
I turned on the option in the gmail account for less secure device.
I don't understand where is the problem... both my code and the example posted here before give me the same error.
If you have any idea...
thanks
regards,
Hicham