problem in retrieving e-mail address through VB 
Author Message
 problem in retrieving e-mail address through VB

Hi!

I am working on a project where i need to use Outlook, which ic configured
for an Exchange server. My all work is done except I'm not able to find a
way to extract the e-mail address of the sender. I am reading whole of my
e-mail but i need the address from where this e-mail came. Please help me in
solving this problem.

Thanks in advance

Rekhender



Sun, 10 Apr 2005 16:40:09 GMT  
 problem in retrieving e-mail address through VB
There is no Outlook property that returns the sender's email address. You
can either use CDO (or Redemption to avoid security prompts --
http://www.dimastr.com/redemption/) to get the From address or use Outlook
to get the Reply To address. Sample code at
http://www.slipstick.com/dev/code/getsenderaddy.htm.

--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
     Microsoft Outlook Programming Jumpstart
     http://www.slipstick.com/books/jumpstart.htm


Quote:
> Hi!

> I am working on a project where i need to use Outlook, which ic configured
> for an Exchange server. My all work is done except I'm not able to find a
> way to extract the e-mail address of the sender. I am reading whole of my
> e-mail but i need the address from where this e-mail came. Please help me
in
> solving this problem.

> Thanks in advance

> Rekhender



Sun, 10 Apr 2005 19:34:09 GMT  
 problem in retrieving e-mail address through VB
Hi,

SUMMARY
This article describes how to programmatically return a
fully qualified sender's address from an Outlook e-mail
message.
MORE INFORMATION
The MailItem object in the Outlook object model contains a
SenderName property, but this property may not contain a
fully qualified e-mail address that uniquely identifies
the sender of the mail message. The SenderName property
contains the string value of the sender's display name. If
the sender is an Exchange user, the display name generally
contains that sender's first and last name. If the user is
not an Exchange user, there is no guarantee what the
string value of the SenderName property will be. The
SenderName property may contain the first and last name of
the sender, the sender's SMTP address, or a combination of
both, such as the following:

The functionality of this property is by design, and it
has been so since Outlook 97. The inability to directly
return a fully qualified e-mail address is a limitation of
the Outlook object model.

You can use one of the following approaches to retrieve
fully qualified e-mail addresses from e-mail messages.

Create a Reply by Using the Object Model
You can create a reply e-mail message and then retrieve
the Address property of the recipient in the Recipients
collection of the new reply message. After you have the
address, you can discard the reply. The following
Microsoft Visual Basic for Applications (VBA) code
illustrates how to retrieve the fully qualified e-mail
address of an open e-mail message:
Sub GetEmailAddressReply()
   Dim objItem As MailItem
   Dim objReply As MailItem
   Dim objRecips As Outlook.Recipients
   Dim objRecip As Outlook.Recipient

   Set objItem = Application.ActiveInspector.CurrentItem
   Set objReply = objItem.Reply

   Set objRecips = objReply.Recipients
   For Each objRecip In objRecips
      Debug.Print objRecip.Address
   Next

   Set objItem = Nothing
   Set objReply = Nothing
   Set objRecip = Nothing
End Sub

Quote:
>-----Original Message-----
>Hi!

>I am working on a project where i need to use Outlook,
which ic configured
>for an Exchange server. My all work is done except I'm
not able to find a
>way to extract the e-mail address of the sender. I am
reading whole of my
>e-mail but i need the address from where this e-mail

came. Please help me in
Quote:
>solving this problem.

>Thanks in advance

>Rekhender

>.



Sun, 24 Apr 2005 11:06:01 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Retrieve Email Address From Returned Mail

2. Retrieve SMTP email addresses of GAB address entries

3. Mail server's address from Email address

4. cdo problem retrieving business address from entry in address book

5. Retrieving Email Addresses from Outlook

6. Retrieving email address.

7. Retrieve Contact Email Address

8. Retrieving Email Addresses From Outlook/Exhange

9. Retrieving Email Addresses From Outlook/Exhange

10. Retrieving Sender's Email Address From MailItem

11. Retrieving senders' email address from Outlook Item

12. How to retrieve email addresses from the WAB ?

 

 
Powered by phpBB® Forum Software