+ Reply to Thread
Results 1 to 5 of 5

Email current user

  1. #1
    Forum Contributor
    Join Date
    06-18-2008
    Posts
    123

    Email current user

    Hi all.

    I have some code that sends the contents of a userform to my email address. Is it possible to change the code to email the current users usercode? Here's a copy of my code:


    Please Login or Register  to view this content.

    Any ideas on this guys?

    Thanks a lot,

    Tony
    Last edited by Tony Vargo; 04-26-2010 at 08:31 AM.

  2. #2
    Forum Contributor
    Join Date
    06-18-2008
    Posts
    123

    Re: Email current user

    I think I may have copied to much code in earlier! This is the only part I want to change:

    Please Login or Register  to view this content.
    I want to change it so instead of an set/fixed email address, it inserts the current users UserName.

    Any ideas on this on guys?

    Thanks,

    Tony

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Email current user

    It depends how your emails are set up - I use

    Please Login or Register  to view this content.
    This will put the logon username before the @ sign - Is that what you are after?

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Email current user

    One of those things that seems like it should be trivial but in reality is not...

    Can we first ask why they need to be the recipient given they are already the sender (ie in their sent items folder) ?

    If you're fortunate enough that the NT username is also short hand email address you could use that, to test, in VBE immediate window type:

    Please Login or Register  to view this content.
    Now create a new mail item in Outlook and type in the resulting value and see if OL resolves for you (ie to your mail account) ... if it does it's still by no means watertight.

    In short retrieving the mail address of the current user can be a PITA - using LDAP, Redemption etc... if you google you'll find a few examples.

  5. #5
    Forum Contributor
    Join Date
    06-18-2008
    Posts
    123

    Re: Email current user

    Thanks for your replies both.

    I went with Kyle123's suggestion as that worked perfectly.

+ Reply to Thread

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.6.0 RC 1