Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How to send email on mc70 with vb 2005?

Posted on 2010-01-05
11
Medium Priority
?
302 Views
Last Modified: 2013-12-27
How to send email on mc70 with vb 2005?
0
Comment
Question by:fmccline
  • 6
  • 5
11 Comments
 

Author Comment

by:fmccline
ID: 26182314
I am pretty new to writing code for mobile devices.  I have written the application in vb 2005 and it sends email well.  Howeve when I load it on the unit it does not work.  This is for a project i am working on for my job.  
                 
0
 
LVL 24

Accepted Solution

by:
alexey_gusev earned 2000 total points
ID: 26183081
create vb.net project for Smart Devices and Compact Framework v2.0, then add a reference to PocketOutlook, then you can have something like that:

Imports Microsoft.WindowsMobile.PocketOutlook

Public Class Form1

    Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click
        Close()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim session As New OutlookSession
        Dim accnt As EmailAccount = session.EmailAccounts("yourname")
        Dim msg As New EmailAccount
        ' setup all you need
        accnt.Send(msg)
    End Sub
End Class
0
 

Author Comment

by:fmccline
ID: 26193522
Thank you for the response.  I have not tested it yet. I am still having a problem with getting the "to" , "from" section done..
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 24

Expert Comment

by:alexey_gusev
ID: 26193574
what kind of problems?
from will be usually taken from account settings (and you have all accounts in session.EmailAccounts collection)
for "To", you can either allow entering free text or again use PocketOutlook to fetch Contacts
0
 

Author Comment

by:fmccline
ID: 26195252
This is the code i am using.

Public Sub email_this(ByVal sender As String, ByVal client As String)
        Const fmcc = "fmccline@gmail.com.com"

        Dim session As New OutlookSession
        Dim msg As New EmailMessage
        Dim accnt As EmailAccount = session.EmailAccounts(fmcc)

        With msg
            .To (i get "Property access must assign to the property or use its value.")
            .Subject = "RNG Boxing Application Update"
            .BodyText = "this is a test"
        End With

         accnt.Send(msg)
    End Sub
0
 
LVL 24

Expert Comment

by:alexey_gusev
ID: 26195380
first of all, define

Const fmcc as String = "..." '<- whatever address you like
0
 

Author Comment

by:fmccline
ID: 26293606
Below is my current  code.  I've tried to add msg.to with the client varible but it's still giving me errors.
---

    Public Sub email_this(ByVal sender As String, ByVal client As String)
        Const p1lines As String = "p1lines@itps-llc.com"
        Const fmcc As String = "fmccline@gmail.com"

        Dim session As New OutlookSession
        Dim msg As New EmailMessage
        Dim accnt As EmailAccount = session.EmailAccounts(p1lines)

        With msg
            .Subject = "RNG Boxing Application Update"
            .BodyText = "this is a test"
        End With

        accnt.Send(msg)
        session.Dispose()
    End Sub
0
 
LVL 24

Assisted Solution

by:alexey_gusev
alexey_gusev earned 2000 total points
ID: 26294916
look here, you'll get an idea (it's in c#, but 100% straightforward):

http://www.eggheadcafe.com/software/aspnet/31662540/sending-mail-in-c.aspx
0
 

Author Comment

by:fmccline
ID: 26295858
That help me with that portion, but i am know getting a "NullReferernceexception was unhandled" error message on the below statement.  
    email.Send(session.EmailAccounts("p1lines@itps-llc.com"))
0
 
LVL 24

Expert Comment

by:alexey_gusev
ID: 26300226
yes, I reckon you don't have the account with such name

verify on the device, what accounts do you have there in Pocket Outlook? Usually by default you have ActiveSync and also SMS and MMS (for phone editions).

you might have you created such account manually of course, but it's worth checking.
anyway, you can iterate through session.EmailAccounts collection to list all available accounts
0
 

Author Closing Comment

by:fmccline
ID: 31673040
This was my first time receving help within hours of my initial request.  This is a great service.  I was able to complete this phase of my project based on the help i received.  
 
Thank you,
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, I read that Microsoft has analysed statistics for their security intelligence report. It revealed: still, the clear majority of windows users do their daily work as administrator. An administrative account is a burden, security-wise. My ar…
Unable to change the program that handles the scan event from a network attached Canon/Brother printer/scanner. This means you'll always have to choose which program handles this action, e.g. ControlCenter4 (in the case of a Brother).
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question