Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Identifying email sender

Status
Not open for further replies.

furtivevole

Technical User
Jun 21, 2001
84
GB
I'm setting up an email response to an event using CDONTS or similar, including the line that's always quoted as something like:

Code:
oMail.from = me@mydomain.com

The app will be used by intrenet users worldwide, all AFAIK with Outlook clients. How do I get the real value for me@mydomain.com programmatically?

Also, can I set a delivery and/or read receipt programatically?

(The email is largely pre-populated, but I need to show it to the user as there may be additional things that they need to include manually. It is then sent manually.)

Many thanks.
 
What do you mean by "the real value for me@my...." I haven't seen a way to execute return receipts...that would be cool though.
 
The actual value, rather than some illustrative "me@mydomain.com", "someone@myisp.com" etc... This value can't be hardcoded in this situation, and I certainly don't want to have to ask users to give their email addresses. How does an Outlook or similar client know the sender's address?

Thanks, Linnet
 
There is no way this can be done for very obvious security reasons.
Outlook "knows" the users email because the user themselves enters it into their profile (or a system admin created the profile).
The only way this would be possible is for every user to be part of the same active directory domain and then use ADSI to query the AD database.

currently you cannot set delivery or read recipts using CDO (CDONTS or CDOSYS).

Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
Outlook knows your address because (at least in most cases) you have signed onto a computer and authenticated. Outlook authenticates with the same credentials (again, this is how it is usually set up)

As Chris stated, if you are getting any user information (username, first name, last name, etcn - anythin stored in exchange/A-D) then you can derive the users email address...This is a function I wrote to get some information, including email address based on a users last name..It does not necessarily provide you with only one result, naturally..

Code:
Function ConfirmMail(LastName)
Dim conn
Dim rs
Set conn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
conn.Provider = "ADSDSOObject" 
conn.Open "Active Directory Provider","DC=YourDomain,CN=ValidUserName","PassWord"
Set rs = conn.Execute("<LDAP://YourAD>;(&(objectClass=organizationalPerson)(sn="&LastName&"));Mail,givenName,sn,Extension-Attribute-1;subtree")
conFirmMail = rs.getRows
End Function


'Run function and print array contents
Dim try
try = ConfirmMail("Jones")
For cnum = 0 To UBound(try,2) 
response.write try(1, cnum) & " " & try(2, cnum) & " " & try(0, cnum) &  "<BR>"
Next



Use your resources, you're on the internet!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top