11-16-2017 05:13 AM
I'm trying send email via SMTP.
LabVIEW SMTP example doesn't work (no error, but no email)
This code works successfully in edit mode.
But in exe I get this error
"Inner Exception: System.Net.Sockets.SocketException: An attempt was made to access the socket with a method that was denied access rights"
what does it mean?
exe and vi works in one login session, without Admin rights.
How to fix this error?
11-16-2017 11:14 AM
screenshots are completely useless
11-17-2017 06:44 AM
@nyc_(is_out_of_here) wrote:
screenshots are completely useless
In his defence, it is a code snippet.
11-17-2017 07:49 AM
It looks like one, but I wasn't able to get LabVIEW to import it properly, can anyone else?
11-17-2017 08:01 AM
@arteitle wrote:
It looks like one, but I wasn't able to get LabVIEW to import it properly, can anyone else?
It's everyone. But it's not his fault. It's a problem with downloading the images and how you do it. See:
https://forums.ni.com/t5/Feedback-on-NI-Community/Snippets-are-broken/td-p/3658760/page/3
11-17-2017 08:28 AM
Artem,
When you try running the exe as an administrator, do you receive the same error?
Also, I see you're using port 25. That port is blocked by some firewall/anti-virus software and even some ISP's will block it to prevent spam. You can read a little more info about it here:
"Errors with SMTP Email VIs": http://digital.ni.com/public.nsf/allkb/42556976302AFF3C86256D7C0080AB5C
Regards,
11-17-2017 11:35 AM - edited 11-17-2017 11:36 AM
Most likely your SMTP Client configuration is not correct. See this note on MSDN about the parameters for the SmtpClient constructor:
The host and port parameters set the value of the Host and Port properties, respectively. If host is null or equal to String.Empty, Host is initialized using the settings in the application or machine configuration files. If port is zero, Port is initialized using the settings in the application or machine configuration files. The Credentials property is initialized using the settings in the application or machine configuration files.
Are you sure you have a configuration for your executable application or a valid machine configuration for the email server on the machine you try to run your executable?
Unless you have mail configured on your computer you most likely don't have a valid machine configuration for SmtpClient and it is unlikely that you have a valid smtp configuration added to your LabVIEW schema file.
11-18-2017 05:27 AM
Thanks for the support and advice.
The settings are correct. LabVIEW successfully sends messages, the problem is only with exe.
I consulted with the system administrator. Problems in the settings of the firewall.