LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

1172 Error

Hey all,

 

I am currently working on a VI that I want to use to send an email of a data base file to an email recipient.  I want this email to send the data base attachment each week.  I found a nice example that uses gmail as the SMTP and I have it working nicely for smaller attachments(less that 1MB attachments).  When I try to attach anything larger than that it runs for about 30 seconds then comes up with the 

 

Error 1172 occurred at 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 operation has timed out.)

 

At first when this 1172 error occurred it was because I did not have port 587 open in the firewall settings.  Once I did that I was able to send emails successfully(with smaller attachments)  I did get a 2MB file to send twice out of like 5 attempts.  The other attempts timed out.

 

Now I have put a stacked sequence around the attachment Property node with a 2 sec wait to try and let the attachment process.  This has seemed to work with a larger 4MB file but I am not sure if this is the way to go about doing this.

 

What is the timed out timing on this issue?  I made it bold in the error message above.  What is the default time out for the Invoke Node?  

 

Attached is the gmail.VI I am using along with the send_DB_Email.VI that uses the GmaiLV86.VI

 

Regards,

 

Steve

Download All
0 Kudos
Message 1 of 3
(3,932 Views)

Hello Steve,

 

The error is occurring because the .Net functions don't have time to complete the desired task.  There is a specific SMTPClient Property that allows you to set the Timeout.  According to the .Net SMTPClient Timeout Property the default value is 100 seconds, information found at this link.

 

It would be good to know where the error actually occurs.  A good way to test this is to eliminate the error wires and add an error indicator to the different property and invoke nodes to determine which function causes the error. 

 

Regards,

M. Whitaker
ni.com/support
Message 2 of 3
(3,889 Views)

I will try and add an error indicator and see exactly where it occurs but yes it seems there is not enough time for the .Net function to complete.  I assume the task that it is trying to complete is attaching a large data base file to the email. 

 

Thank you for the suggestion and information on the Timeout Property

 

Steve

0 Kudos
Message 3 of 3
(3,871 Views)