LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

smtp credentials with .net could not be wired in labview

Errr... what exactly was I wrong on?

I said that he needs the 7.1.1 update. I also said that when I opened the VI in 8.2 there was no broken wire. Initially I thought the wire problem was due to a class conflict based purely on what LabVIEW was telling me in the Help window with the wire tool on the wires. I then followed up after the poster's quote of the snippet of code, and said that wiring the output of the NetworkCredentials to the "Credentials" property of SMTPClient should have worked. It does in 8.2, but not 7.1 or 7.1.1. I concluded the problem was with LabVIEW 7 since it works in LabVIEW 8. That's why I suggested the "To More Specific Class". I have no idea if it would have worked when run (assuming he had 7.1.1), but I left it to the poster to try.

Please enlighten me.


As for alternate methods for sending authenticated emails I would suggest using the OpenG SMTP library. I am currently using it. I did have to make modifications to it since the library hasn't been updated. In my case our mail server I use explicitly adheres to spec 822bis section 2.3 (no bare LFs).
0 Kudos
Message 11 of 15
(1,223 Views)

Relax Guy!  Both you and hepman got posts in before I had time to try it myself and get a response in. 

Anyway, if hepman is still paying attention, LV 7.1 is pretty bad about type inheritance.  I tried using a straight type cast rather than a "To More Specific Class" and it seemed to work just fine.  Though again, I was using 7.1.1f2. 

0 Kudos
Message 12 of 15
(1,211 Views)
straight type cast work, but I get back error 1172 at SmtpMail.Send( mail )

there is another solution with net 1.1:

MailMessage mail = new MailMessage();
mail.To = "me@mycompany.com";
mail.From = "you@yourcompany.com";
mail.Subject = "this is a test email.";
mail.Body = "Some text goes here";
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "my_username_here"); //set your username here
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "super_secret"); //set your password here

SmtpMail.SmtpServer = "mail.mycompany.com"; //your real server goes here
SmtpMail.Send( mail );

but I cannot fiend msg.Fields.Add

0 Kudos
Message 13 of 15
(1,195 Views)
Smiley Happy Dear All, Problem is solved ... thank you, guys ...

The easiest way is to use a simple .net 2.0 program (attached) and create an acount  at www.mail.ru,
they do not use smtp authentification.

could  be that this not the safest way, but to send some not so important Information out of a running Vi....

..... may be there are some other free providers do not use smtp authentification ....


Best Regards

Hepman
0 Kudos
Message 14 of 15
(1,189 Views)
Dear All,

Solution with mail.ru works only on one Computer, ... checking IP or Domain...

But Solution from Codeman works with labview 7.1 English and  .net 2.0 English.
On the former Computer I work with  Labview  7.1 German and .net 2.0 German, so it seems to be a bug in one of that versions.

Thanks ones again for your help.

Best Regards

Hepman
0 Kudos
Message 15 of 15
(1,179 Views)