Creating Mail from CF

P

Patrick Long

A while back i asked on here how I could do the equivalent of a mailto:
fr4om Compact Framework. I was "helpfully" told that it could be done with
such-and-such 3rd party product.

Well i did not want to use a 3rd party product for what i thought was
something fairly simple. Well i am glad to say it is fairly simple and can
be done with a combination of two techniques.

1. Implement some P/Invoke to ShellExecute see here:
http://www.opennetcf.org/Forums/topic.asp?TOPIC_ID=263
2.Call TMail.exe (the Outlook Mail Client) with or without command line
params
see here: http://www.nsbasic.com/ce/info/nsbce/technotes/TN17.htm

Job done.

HTH

Pat Long
 
F

Fabio Pagano

Thanks for posting.

Fabio

Patrick Long said:
A while back i asked on here how I could do the equivalent of a mailto:
fr4om Compact Framework.
---CUT---
 
S

sureshot

hi, please can someone help/give me an idea? I have referenced Imports
OpenNETCF.WinAPI.Core
I have a click event as follows:

Private Sub btnPOutlook_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
btnPOutlook.Click

Dim eTo As String = "mailto:" & "(e-mail address removed)"
Dim eSubject As String = "?subject=" & "PPC device
Exception!"
Dim eBody As String = "&body=" & "Please Log a Call"
'Dim eAttachment As String = "&attach=" & "\My
Documents\ExceptionHandler.txt"
'Dim eAttachment As String = "&attach=" & """\My
Documents\Exception Handler.txt"""
Dim eAttachment As String = "&attach=" & ExceptionFileName
ShellExecute("tmail.exe", eTo & eSubject & eBody &
eAttachment)

End Sub

mailto, subject and body work fine. attachment will not
no matter what syntax i use to the existing fileName in
My Documents.
Has anyone used/tested this. Is there a way to make it
work or is it a myth that it works at all?

Marc.
 
B

Boris Nienke

mailto, subject and body work fine. attachment will not
no matter what syntax i use to the existing fileName in
My Documents.
Has anyone used/tested this. Is there a way to make it
work or is it a myth that it works at all?

i havn't tested it yet - but in C# you would have to use
double-backslash in a string and "\"" to get the "

i don't know about VB

so i would expect

"\"\\My Documents\\ExceptionHandler.txt\""

to work. I need the Attachment thing too but i can't try at the moment

Boris
 
B

Boris Nienke

i havn't tested it yet - but in C# you would have to use
double-backslash in a string and "\"" to get the "

i don't know about VB

so i would expect

"\"\\My Documents\\ExceptionHandler.txt\""

to work. I need the Attachment thing too but i can't try at the moment

have tested it :-( i won't work.

When i use the "mailto:"-syntax the PocketOutlook will come up with my mail
- but without attachment.

When i use the "tmail.exe -TO="..." ..." Syntax i get the hourglass for a
very long time - system hangs - no PocketOutlook comes up

don't know what's wrong :( would be nice if someone knows a solution...

Boris
 
C

C. Vollmer

Boris,

I think I remember a discussion about the "-attach" parameter a few
months ago. I think the result was, that "-attach" did only work with
pmail in PPC2000. Since tmail PPC2002 it doesn't work anymore. Maybe you
have to do it without the attachment.

Christoph
 
B

Boris Nienke

Crazy... but fits into the whole story of MS :)

but fact is: i only like to do a mail BECAUSE of the attachment ;) I would
like the customer to send a info-file to the support - i could live without
body ... but not without attachment.

any idea how to send a file via email with C# on a PPC2002/WM2003 Device?

thanks

Boris
 
C

C. Vollmer

Search Google Groups for more infos. Maybe you could use attach without
the rest (to, body, ...). Would that help? But I'm not shure about
WM2003. Maybe it is different again? Have you tried? I don't have a
WM2003 to test it.

Christoph
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top