How to get the current users email address from outlook on PPC

G

Guest

We have a PPC app that generates reports and sends them out through email. We
are using Alex Yakhnin's code
(http://blog.opennetcf.org/ayakhnin/CategoryView.aspx?category=Send Email)
to send email with attachments given the SMTP server. I am supplying the FROM
and TO email addresses to this code. The thing is you can always specifiy
someone else's email address other than the device owner in the FROM field.

I would like to know if there is a way to find out the email address of the
device user from Pocket Outlook so that I can populate the from field
automatically without the user entering it.

Any help would be appreciated.

Venkat Polisetti
 
P

Peter Foot [MVP]

You can get the owners address from the registry where it is stored if
entered in the Owner Information settings applet. The data is stored as a
binary value with specific offsets into each of the sections, name, company
email etc at
HKEY_CURRENT_USER\ControlPanel\Owner
The email address should be stored from byte 283 onwards. You can access the
registry using the OpenNETCF.Win32.Registry class (www.opennetcf.org/sdf/)

Peter
 
G

Guest

Peter,

Thank you for your reply.

Getting it from the Registry is one way to get at it if the use chooses to
enter his email address there. There is a chance that the user may not have
entered email as part of the owner info.

What I am really looking for is how to get it from the Pocket Outlook as the
device user is going to sync up his email with that of the Desktop.

Thanks again.
Venkat Polisetti
 
P

Peter Foot [MVP]

Pocket Outlook will allow you to get any contact email address held on the
device, but how are you going to determine which is that of the owner (if
any)?

Peter
 
G

Guest

Peter,

I thought the Pocket Outlook would store the current user's email address
some place so that when we send email from PPC it would automatically set the
FROM address on the outgoing email. Also when I sync up with my desktop it
sends it with my address as the sender. I have no idea how outlook works.

Venkat Polisetti
 
P

Peter Foot [MVP]

The from address on any email accounts you setup on the device is stored
within those account settings. If you use the ActiveSync account it will be
sent using the email settings on your desktop outlook. So in theory you
could extract the users email address from an email account if set up on the
device, but this would probably require some work with MAPI which is COM
based and not directly supported from .NETCF currently.

Peter
 

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