+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Spammer
    Join Date
    02-26-2009
    Location
    U.S
    MS-Off Ver
    Access
    Posts
    73

    Problem in Sending a test email to sender's own account.

    Hello,

    I've written a program that sends an email to everyone on an Excel
    spreadsheet mailing list. I want the user to be able to send themselves a "test" mail, to confirm that the contents and attachments are correct,
    before sending to the whole list. Is there a way to get Outlook to find the current user's address to put in the To field? Something like:- Message.To = ME, where ME is the current user's address?
    But i m not getting the appropriate results can anyone tell me how to to that?

    Thanks in advance.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    10,938

    Re: Problem in Sending a test email to sender's own account.

    Code:
    Sub x()
    
        Dim olApp As Outlook.Application
        Dim olMAPI As Outlook.Namespace
        
        Set olApp = CreateObject("Outlook.application")
        Set olMAPI = olApp.GetNamespace("MAPI")
        
        MsgBox olMAPI.CurrentUser.Address
        
    End Sub
    Cheers
    Andy
    www.andypope.info

  3. #3
    Spammer
    Join Date
    02-26-2009
    Location
    U.S
    MS-Off Ver
    Access
    Posts
    73

    Re: Problem in Sending a test email to sender's own account.

    Thank Andy for your reply tried this and its working.Thanks very much.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.2.0