LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SMTP Problem with the recepient adress

Solved!
Go to solution

Hi, i made a copy of the SMTP Email Send message fonction to be able to use it with a diffrent smtp port (like 587). Everything is working fine when the recipient adresse is like myname@hotmail.com or any normal adress. The problem is when i'm trying to use this fonction to send an email to an adress like myname@mail.compagny.com. Every email adress of the compagny are like the second exemple. Does someone have an idea to solve this probleme?

0 Kudos
Message 1 of 9
(3,262 Views)
Solution
Accepted by topic author mchevrier

I had the same problem using my @msu.edu email server.

The problem is a lot of companies use TLS or SSL security settings.

There are ways to get around this.

 

I attached a VI that should work for you.

I cannot take credit for the VI, it was given to me by someone on the forums.

I just modified it a little bit.

 

Edit: If you look at the block diagram, towards the top, there is an invoke node.

It is for 'SMTP Client', and the element is 'host'.
You will need to change that from 'mail.msu.edu' to whatever server your company uses.

And you may need to change the port as well.

 

I also customized the VI's icon, but you can leave that if you like it Smiley Very Happy

Message Edited by Cory K on 05-22-2009 04:13 PM
Cory K
Message 2 of 9
(3,250 Views)

i forgot to specify that i'm using a external smtp serveur like smtp.gmail.com on port 465 or smtp.polymtl.ca port 587. Those two smtp server doesn't any authentification.

Thanks for the answer, i trying the code you posted and it doesn't work for me.

 

I tried another code i found here on the forum that use the outlook application to send the email but it need Outlook to be open when the vi is called. This is not really what i need. Anyone have an idéa to use directly microsoft Exchange server or send a email via an external smtp server?

0 Kudos
Message 3 of 9
(3,217 Views)

Hi,

 

i had also the same problem. To solve it I'm using the .NET Mail components and not the SMTP-Library because the standard labview SMTP-library doesn't provide a authentication.

 

I've attached a screenshot of my mail example.

 

HTH

--
Joachim

0 Kudos
Message 4 of 9
(3,214 Views)

Thanks for the quit answer. I can't find the .net Mail components

0 Kudos
Message 5 of 9
(3,203 Views)
Joachim082: i already tryed this code (found somewhere else on the forum) and it doesn't work for me. Labview is not answering after i press run.
0 Kudos
Message 6 of 9
(3,190 Views)

mchevrier,

 

which version of the .NET component do you use? I am using labview 8.6.1 with .net 2.0. I've attached a screenshot with the constructor selection.

 

hth

--
joachim

0 Kudos
Message 7 of 9
(3,170 Views)

I'm using exactly the same version of labview et .net. The code on the screenshot you posted is the same as Cory K posted before Email_SSL.vi and it doesn't work here. :S

 

I think that the problème is not the authentification because the server that i use does not need one, but the email adress itself cause the problem. Anytime i put a dot in the adress like firstname.famillyname@myemail.com or username@sub.domain.com it doesn't work. When i send the email to a regular adress like myname@hotmail.com. It works well. i just don't understand.

 

I tried to connect directrly on my smtp server via telnet and send the command manually and it doesn't work when i put a adresse like username@sub.domain.com.

 

Message Edité par mchevrier le 05-26-2009 06:09 AM
0 Kudos
Message 8 of 9
(3,149 Views)

Thanks Cory K and Joachim082. My problem is solve, i used the code that Cory posted here with our internal microsoft Exchange server but i put False to EnableSSL because it doesn't support SSL authentification.

Thanks for the help. 

0 Kudos
Message 9 of 9
(3,134 Views)