LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I launch the default e-mail client?

There's more info here on mailto, but I couldn't find a way through mailto to actually send the email.
If you're using Outlook, look at the sample project that ships with CVI:
...\CVI\samples\activex\outlook\outlookrep2000.prj.
See the callback SendEmail.
0 Kudos
Message 11 of 14
(1,397 Views)
Foxfire,

If you would like to generate the message and automatically send it through CVI I would suggest looking at the InetSendMail function. Will will allow you to send an email directly through an SMTP server.

int InetSendMail (const char *Server, const char *From, const char *To, const char *Subject, const char *Message_Text, const char *Attachments);

Alternatively, if automating the default email client is necessary, another option might be using ActiveX to programmatically control the email client

Scott Y
NI
0 Kudos
Message 12 of 14
(1,599 Views)

I tried the same call but nothing happens.

ShellExecute( NULL, NULL, "mailtoerson@company.com", NULL, NULL, 0);

What I want is only to open a new mail with the adress and subject field filled in.

The body must be written by the user.

Thanx in advance

0 Kudos
Message 13 of 14
(940 Views)

Hi PerBorgvad,

the correct syntax for mailto requires the command is separated from the address with a ":"; informations on mailto command are available on the interenet, for example here: you can add the subject by embedding it in the command:

mailto:address@server?subject=Subject

 

I never really tried it within CVI environment but it should work.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 14 of 14
(933 Views)