LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

InetSendMail Error Question

Solved!
Go to solution

Hello,

 

I have a problem using InetSendMail (SMTP sever, From_Email, To_Email, Subject, Message, attachment) function.

 

If I directly use a string in To_Email position as "xxxx@xxx.xxx" then the functions works well and I can send emails.

 

However, if I use,

 

char To_Email[30] ="xxxx@xxx.xxx";  and use  InetSendMail(..) function with  To_Email (e.g. InetSendMail(..,.., To_Email,..,..), then I always got an error -7. 

 

Can anyone give me a advice?

 

Thank you.

0 Kudos
Message 1 of 3
(3,264 Views)
Solution
Accepted by topic author Shre07

Try declaring it as:

 

const char* To_Email = "xxxx@xxxx.xxxx";

 

Let me know if that makes a difference in your code.

Tanya Visser
National Instruments
LabVIEW Group Manager
0 Kudos
Message 2 of 3
(3,222 Views)

 It works.

Thank you.

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