LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Send email with file attachment in CVI

I would like to send automatically an email to an user, where the results of a test are attached as file. I used LabWindows CVI 5.0.1 and ActiveX will not work. I have tested to send the email by SMTP (SendMail), but it was only possible to send text in the message body. I didn't realised to attach the file. Also I have tried to use the "cmd /c start mailto:xxx@xxx.com?subject=text" command, but I didn't find a solution. May someone help me to find a solution to send an email with file attachment.
0 Kudos
Message 1 of 5
(3,941 Views)
Good Morning .

The best option to send a mail is use the "CVI intenet toolkit".
There is in this toolkit an fp instrument to send a mail.

With this instrument is very easy send a mail with a flie.

This function send a mail
#define YOUR_SMTP_ SERVER "mailhost.terra.es"
#define TO_MAIL "f.bermejo.garapen@adegi.es"
#define FROM_MAIL "fb.Automation@terra.es"
#define SUBJECT "Es una prueba"
#define MESSAGE_TEXT "Es un mensaje de aviso de ciorrreo........."
int EnviarMensaje(void)
{
int error;

error = INET_SendMail(YOUR_SMTP_
SERVER,FROM_MAIL,TO_MAIL,SUBJECT,MESSAGE_TEXT,"c:\Analisis.doc");
if (error<0)
{
MessagePopup("AVISO","Error primero");
return 0;
}

return 1;

}


Best Regards,
Tximiskurdi
0 Kudos
Message 2 of 5
(3,940 Views)
Thank you for the answer and it will be sure an easy solution, but the email feature will be only a nice to have function in my program and it will be not possible to spend money on this. Are there any possibilities without updates or toolkits?
0 Kudos
Message 3 of 5
(3,940 Views)
On Tue, 13 Jan 2004 04:14:21 -0600, Christian007 wrote:

> I would like to send automatically an email to an user, where the results
> of a test are attached as file. I used LabWindows CVI 5.0.1 and ActiveX
> will not work. I have tested to send the email by SMTP (SendMail), but it
> was only possible to send text in the message body. I didn't realised to
> attach the file. Also I have tried to use the "cmd /c start
> mailto:xxx@xxx.com?subject=text" command, but I didn't find a solution.
> May someone help me to find a solution to send an email with file
> attachment.

If you have LabVIEW you could see how the OGIC library does it:
http://openg.org/tiki/tiki-index.php?page=OpenG+Internet+Connectivity+Tools

It handles attachments using base64 (MIME) encoding and
doesn't use any
ActiveX, just pure TCP. Should be easy to convert to C.
0 Kudos
Message 4 of 5
(3,940 Views)

i have same problem with Methis Elddir...

0 Kudos
Message 5 of 5
(3,140 Views)