LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

smtp credentials with .net could not be wired in labview

Dear All,

could someone help me why i can not connect wires in attached vi pictures.
I like to write a E-Mail program, however smtp requires authorization.

Best regards

Hepman
Download All
0 Kudos
Message 1 of 15
(3,891 Views)
When I opened your VI there was no broken wire. Are you sure you have .NET 2.0 installed? System.Net.Mail is in .NET 2.0. If you have .NET 2.0 check to make sure you don't have a labview.exe.config file in the same directory as LabVIEW that is explicitly telling LabVIEW which version of .NET to use.
0 Kudos
Message 2 of 15
(3,873 Views)
Dear Smercurio,

I working with labview 7.1
What do you mean with
labview.exe.config file, the LABVIEW.ini? Where could I find  what labview use as .NET.
Is it also possible to deinstall .NET ver.1.0.?

Best Regards

Hepman

0 Kudos
Message 3 of 15
(3,866 Views)

For proper support of .NET 2.0 in LabVIEW 7.x you need to install the patch to get it to 7.1.1. You can read more here.


 
0 Kudos
Message 4 of 15
(3,863 Views)
That said, you will still have a broken wire since you cannot create the connection you're trying to make. The reason is that you cannot provide the class "NetworkCredential" to "Credentials" since "Credentials" takes a differenct class. I would suggest looking at the site http://www.systemnetmail.com/ for an explanation of how to use System.Net.Mail.
0 Kudos
Message 5 of 15
(3,862 Views)
there is written:
smtp.Credentials = new NetworkCredential("username", "secret"); 

Is this not the same class?

Is it possible to convert somehow the classes.

The class could be the same as seen in the attached picture, but how to select or to connect?


0 Kudos
Message 6 of 15
(3,861 Views)
Hmmm.. you're right, that should work. It looks like the problem is LabVIEW 7. When I opened your VI I opened it in 8.2 and the wire was fine. You could try typecasting using the "To More Specific Class" as shown in the attached modification to your VI.

Note: You will still need the 7.1.1 patch in order to get .NET 2.0 to work properly.
0 Kudos
Message 7 of 15
(3,854 Views)
I can not convert to labview 7.1.1, because I have to support several machines where I can not change version.

By testing your vi I get the error 1057,  it is not possible to convert to this class.
0 Kudos
Message 8 of 15
(3,852 Views)
smercurio was wrong on that last one (it happens).  I'm working in LV 8.2, but I completed the mail.vi and sent myself an email; no broblems, no errors.  I'll attach the pic.  Smercurio was correct about the 7.1.1 patch though to avoid confusuion: You must patch LV 7.1.1 to LV 7.1.1f2.  (His link was correct for the patch).  If you have done that and still can't get a solid wire, the problem might be with the .net installation.  Make sure you don't have any of the .net 2.0 beta installs and that .net 2.0 framework is working OK.  You might give the .net classes a wirl using something outside LabVIEW like Visual Web Developer or a simple asp.net web form just to make sure the classes are working properly.
0 Kudos
Message 9 of 15
(3,848 Views)
7.1 is not compatible with .net 2.0.  Nothing to do about it if you can't convert other than use use .net 1.1 or use alternative e-mail means.  You can still use the e-mail vis that were part of the internet development toolkit.
0 Kudos
Message 10 of 15
(3,847 Views)