Results 1 to 6 of 6

Thread: email smtp

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2008
    Posts
    42

    email smtp

    i have got error message when i debugging it,,
    ERROR message : Nullreferenceexception
    what is wrong with my code??

    my code:


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    Dim message As New EmailMessage
    message.Subject = "test email"
    message.BodyText = " test done"

    Dim client As New Recipient("ABC", "[email protected]")
    message.To.Add(client)
    Dim emailsession As New OutlookSession
    emailsession.EmailAccounts("Gmail").Send(message)'<<<error here
    MsgBox("email sent")


    End Sub
    Last edited by husky_doggy; Dec 1st, 2008 at 01:54 PM.

  2. #2
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    Re: email smtp

    Hi,
    not used it, but are you sure 'OutlookSession' is correct - should it not be pocketoutlook or similar???
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  3. #3

    Thread Starter
    Member
    Join Date
    Nov 2008
    Posts
    42

    Re: email smtp

    Quote Originally Posted by petevick
    Hi,
    not used it, but are you sure 'OutlookSession' is correct - should it not be pocketoutlook or similar???

    ok...it is fixed now..it was the account name

    but i have another queston..
    i was just testing if the code works...so now it works and show the message to inform user " email sent" when i debug it on my phone.

    what i want to know is ...is that just a simulation and i wont receive an actual email for it? ( because i didnt receive anything, but the inform message was display), and i am sync'ing with the pc with internet access.

    or i should receive the email???
    Last edited by husky_doggy; Dec 2nd, 2008 at 11:12 AM.

  4. #4
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    Re: email smtp

    Can you send an email from your phone using that account by using the 'normal' messaging?
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  5. #5

    Thread Starter
    Member
    Join Date
    Nov 2008
    Posts
    42

    Re: email smtp

    Quote Originally Posted by petevick
    Can you send an email from your phone using that account by using the 'normal' messaging?
    yes i can , but once i use usb to sync to debug my application..it cant send email..but can still go on internet.

    actually i think it is while within the application i can not send email at all..
    and i found out that if i send an email within in the program ..the next time i uses 3G to go on internet to download the emails those email i "sent" in the application days ago only get send by then..
    Last edited by husky_doggy; Dec 5th, 2008 at 09:41 AM.

  6. #6
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    Re: email smtp

    What happens if you make an internet connection, and then send your email?
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width