>? getSenderEMail(GetEnv("USERNAME")) > >function getSenderEMail(tcSender as String) as Object > local loOF, loMailItem, loOutlook, loItem, lcEMailAddress, loException, lcLastError > > loMailItem = CreateObject("Redemption.SafeMailItem") > loOutlook = Createobject('Outlook.Application') > loItem = loOutlook.CreateItem(0) > loMailItem.Item = loItem > lcEMailAddress = '' > try > loMailItem.Recipients.Add(tcSender) > if loMailItem.Recipients(1).Resolve() > with loMailItem.Recipients(1).AddressEntry > lcEMailAddress = .Name + ' <' + .SMTPAddress + '>' > endwith > else > * Unable to resolve > endif > catch to loException > lcLastError = Proper(This.Class) + " has encountered a problem." + Chr(13) ; > + "Error Number: " + Transform(loException.ErrorNo) + Chr(13) ; > + "Module: " + 'getSenderInfo' + Chr(13) ; > + "Line: " + Alltrim(Str(loException.LineNo)) + Chr(13) ; > + "Description: " + laError[2] > > MessageBox(lcLastError) > endtry > return lcEMailAddress >endfunc > >