|
-
Oct 20th, 2000, 10:49 AM
#1
Thread Starter
New Member
Does any one know how to retrieve an email address from an outlook email? I am using this method to retrieve the email attachments, Sender name and subject but I can't figure out how to retrieve the senders email address.
Set olapp = CreateObject("Outlook.Application")
Set mnamespace = olapp.GetNamespace("MAPI")
Dim allmessages As Items
Set allmessages = mnamespace.GetDefaultFolder(olFolderInbox).Items
Any help would be appreciated. Thanks.
Mel
-
Oct 20th, 2000, 11:08 AM
#2
Addicted Member
How about trying the ReplyRecipient.Address. I haven't done this before, but it looks promising.
-
Oct 20th, 2000, 12:49 PM
#3
Thread Starter
New Member
Maybe I am missing something but I can't find the ReplyRecipient.address property. Where is it?
-
Oct 20th, 2000, 01:24 PM
#4
Addicted Member
ReplyRecipient is a property of the MailItem object that we probably fill in. I can't find the e-mail address of the sender either. I'll look around and see what I can find.
-
Oct 20th, 2000, 01:34 PM
#5
Addicted Member
I found the answer. Not a good one.
"In Microsoft Outlook, only the sender's Display Name of the original message is added to the body when a message is forwarded or replied to. If the recipient wants to send mail to the original sender, only the Display Name is available. In a Microsoft Exchange Server organization, it is possible to look up the address in the global address list; however, if the original sender is outside of the Exchange Server organization and has no custom recipient entry, it may be impossible to find the e-mail address of the original sender."
Sorry.
-
Oct 27th, 2000, 11:52 AM
#6
New Member
How do you get that info from EXCHANGE?
HDR,
I see that you found a way to do a lookup of a users email address in exchange. I was looking for a way to do that also. Could you let me know how to do it?
I am looking to send a reminder email to each user, whos NT user names are in a list.
Thanks for the help.
And if your really feeling like a challenge, maybe you know of or can find out a way to just post a reminder instead of sending them an email!
Thanks for the help.
NM
-
Oct 27th, 2000, 04:25 PM
#7
New Member
solution!
I found an ingenious solution to this problem (i think). Here's how to get the e-mail address of an incoming e-mail:
1. Install the Generic / Text Only printer in Windows 98. Set it to print to a file.
2. In Visual Basic, use the line "mailitem.PrintOut" (where mailitem is the Outlook.MailItem that you want to get the e-mail address of).
3. Open the file you just printed, at the top you'll see:
To: Real Name [[email protected]]
4. grab this address!
Right now, the only problem I've encountered is that the Windows print driver asks you for the file that you want to print to. There's gotta be a workaround for this.
Hope this helps. :-)
- GM
-
Oct 30th, 2000, 08:03 AM
#8
New Member
Recipients e-mail address
Hi,
Which version of Outlook are you using?
In Outlook 2000 I think it is possible to do the following:
Access the ReplyRecipients collection in the mailitem you are interested in. From that you can extract the recipients E-mail address.
I haven't tried this though but it looks like it should work.
Good luck !
-
Nov 28th, 2001, 01:30 AM
#9
New Member
dim allmessages as outlook.items
dim item as outlook.mailitem
Set olapp = CreateObject("Outlook.Application")
Set mnamespace = olapp.GetNamespace("MAPI")
Dim allmessages As Items
Set allmessages = mnamespace.GetDefaultFolder(olFolderInbox).Items
for each item in allmessages.items
msgbox item.sendername
next
if item.sendername just gives u sender name and not email address then u have to parse sender emailid from
item.Reply.Body
try hope will work
-
Nov 7th, 2002, 03:03 PM
#10
New Member
Workaround
Hi.
I read this thread with interest (noting it is a couple of years old!). I am currently involved in a project that requires obtaining the sender's email address using the Outlook object model.
I am glad to say that my project is near completion, and that I have overcome the problem detailed in this thread.
To obtain the sender's email, try this:
function FindSender(theItem as MailItem) as string
Dim reply As MailItem
Dim sender As String
Set reply = theItem.reply
sender = reply.Recipients(1).Address
FindSender = sender
reply.Delete
end function
The (rather obvious, once I finally stopped pulling my hair out) logic is that any reply will obviously be TO the sender, so the recipient can simply be obtained from this.
Note that the only exception to this is when the ReplyTo address in the email is different to that of the sender, but this isn't an issue in my case and I doubt it will be in most others.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|