Help on pocket email

  • Thread starter Thread starter marcmc
  • Start date Start date
M

marcmc

http://www.opennetcf.org/Forums/topic.asp?TOPIC_ID=263

The forum below led me to send you this email before I
begin developing. I am new to .NETCF and need to ask a
couple of questions on the code in the 1st link below.
Hopefully you can help.
I will be using VB.NET.
Where do I copy the code to and what/where do I save it
as.
I assume, add class, copy code to project, add any refs i
need, run and debug and then i should be able to open a
tmail message with certain parameters specified ie to
subject attachments etc etc.
It all looks very confusing to me.

I really need a step by step instruction on how to
genearte emails form a CF.NET App.

marc
 
If you paste the entire code into a new blank code file in your project you
should be able to use this from any other class / form in your project.
If you want a method which doesn't require any editing of code you could
download the WinAPI binary package which has a dll which you can add to your
project using "Add Reference..." this contains ready made code for
ShellExecute and a whole range of other API functions which are simple to
use - see here for details:-
http://www.opennetcf.org/winapi.asp

e.g.

OpenNETCF.WinAPI.Core.ShellExecute("tmail.exe",
"mailto:[email protected]?subject=Test");

Peter
 
can you specify an attachment or indeed a body message

i tried...

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\Exception Handler.txt"
ShellExecute("tmail.exe", eTo & eSubject & eBody &
eAttachment)

End Sub

but only the attachment didn't work!
Is there a way?
 
You probably need to quote the file path since it contains a space:-
Dim eAttachment As String = "&attach=" & """\My Documents\Exception
Handler.txt"""
Notice that Double quotes are an escape for a " in the final string so the
path is encased in triple quotes. The result of this string will be
&attach="\My Documents\Exception Handler.txt"

Peter
 
just cannot get it to do anything, no syntax errors or
exceptions.

have changed file name to have no spaces

have now tried:
"&attach=" & "\My Documents\ExceptionHandler.txt"

"&attach=" & """\My Documents\ExceptionHandler.txt"""

"&attach=" & """\My Documents\Exception Handler.txt"""

This really is a stumper. The document definitely exists
on the PPC and that is the correct path.
 
have also tried
Dim eAttachment As String = "&attach=" & ExceptionFileName

where
ExceptionFileName =

Public ExceptionFileName As String = "\My
Documents\Exception Handler.txt"

has anyone used this or is it a myth that this works?
 
have also tried
Dim eAttachment As String = "&attach=" & ExceptionFileName

where
ExceptionFileName =

Public ExceptionFileName As String = "\My
Documents\Exception Handler.txt"

has anyone used this or is it a myth that this works?

i have tried it with C# too - attachment hasn't worked for me :(
I really need this too.

Boris
 
Back
Top