ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

error 1050 using sendemail

Solved!
Go to solution

Hi,

I have a VI that saves graphs on my computer and also have a matlab script to send these graphs via email. I am getting an error 1050 as shown in the picture attached. Here is the script:

 

setpref('Internet','E_mail','sender's email@gmail.com'); %sender gmail email address
mail = 'sender's email@gmail.com';
password = 'password';
setpref('Internet','SMTP_Server','smtp.gmail.com'); %smtp server set-up


setpref('Internet','E_mail',mail); %sender's email
setpref('Internet','SMTP_Username',mail); %sender's email
setpref('Internet','SMTP_Password',password); %sender's password
props = java.lang.System.getProperties;
props.setProperty('mail.smtp.auth','true');
props.setProperty('mail.smtp.socketFactory.class', 'javax.net.ssl.SSLSocketFactory');
props.setProperty('mail.smtp.socketFactory.port','465');

%Receiver's address, Title, body message, and attachment. To send multiple
%attachment {'C:\yourFileSystem\file.txt','C:\yourFileSystem\file2.txt'}
sendmail('receiver's email@gmail.com','Load Cell Results','Load Cell results can be viewed in the attachments.',{'C:\Users\ameeral.AD\Desktop\loadcell\cell1.bmp','C:\Users\ameeral.AD\Desktop\loadcell\cell2.bmp','C:\Users\ameeral.AD\Desktop\loadcell\cell3.bmp','C:\Users\ameeral.AD\Desktop\loadcell\cell4.bmp'});

 

I intentionally removed the email and password marked with red.

 

Please help Smiley Frustrated

 

 

0 Kudos
Message 1 of 10
(4,652 Views)
You should be talking to Mathworks about a problem with Matlab. Why are you using that instead of the built-in LabVIEW functions?
0 Kudos
Message 2 of 10
(4,629 Views)

I tried using the Send Email function but it does not work. I get an error message about reaching system time limit, please check the attached image here. I am using my gmail account and the SMTP server is smtp.gmail.com on port 465 and I inputed my username and password and checked the box that says: Use secure connection (TLS/SSL). Thank you

0 Kudos
Message 3 of 10
(4,620 Views)

@kingzamzom wrote:

I tried using the Send Email function but it does not work. I get an error message about reaching system time limit, please check the attached image here. I am using my gmail account and the SMTP server is smtp.gmail.com on port 465 and I inputed my username and password and checked the box that says: Use secure connection (TLS/SSL). Thank you


Sounds like you have a problem with your network.

 

 

0 Kudos
Message 4 of 10
(4,611 Views)
What version of LabVIEW are you using?
0 Kudos
Message 5 of 10
(4,589 Views)

@nyc_(is_out_of_here) wrote:

@kingzamzom wrote:

I tried using the Send Email function but it does not work. I get an error message about reaching system time limit, please check the attached image here. I am using my gmail account and the SMTP server is smtp.gmail.com on port 465 and I inputed my username and password and checked the box that says: Use secure connection (TLS/SSL). Thank you


Sounds like you have a problem with your network.

 

 



Maybe, I will have to check.

0 Kudos
Message 6 of 10
(4,585 Views)

@Dennis_Knutson wrote:
What version of LabVIEW are you using?


LabVIEW 2013 version 13.0 (64 bit)

0 Kudos
Message 7 of 10
(4,583 Views)
That version does not support authentication/SSL that Gmail requires. Search the board. There is code that uses .NET.
Message 8 of 10
(4,556 Views)

Hi! Please check that the MathWorks, Inc. MATLAB ® software is set to the same working directory as LabVIEW. The MATLAB®  script will call the MATLAB® server, which may not be in the same directory as LabVIEW.

 

To do this, open MATLAB® and select File»Set Path... from the pull-down menu. In the Set Path window select Add Path... to add the path where your function scripts are located to the MATLAB® search path.

 

Failing this, the error may also occur if there is a disruption in this script server between MATLAB® and LabVIEW. Try restarting both programs.

 

MATLAB® is a registered trademark of The MathWorks, Inc.

0 Kudos
Message 9 of 10
(4,529 Views)
Solution
Accepted by topic author kingzamzom

I used Yahoo authentication instead of Gmail in my Matlab script and the error is cleared. Thank you all

0 Kudos
Message 10 of 10
(4,428 Views)