Below is the sql query to get vendor email address. Please change it according to your requirement.
select VENDTABLE.ACCOUNTNUM as VendorId, DIRPARTYTABLE.NAME, LogisticsElectronicAddress.DESCRIPTION as Type,LogisticsElectronicAddress.LOCATOR as Email , LogisticsElectronicAddress.ISPRIMARY, LogisticsLocationRole.TYPE, DIRPARTYLOCATION.PARTY, VENDTABLE.dataareaid from VENDTABLE
join DIRPARTYLOCATION on VENDTABLE.PARTY = DIRPARTYLOCATION.PARTY
join LogisticsElectronicAddress on DIRPARTYLOCATION.LOCATION = LogisticsElectronicAddress.LOCATION
join LogisticsElectronicAddressRole on LogisticsElectronicAddress .RecId = LogisticsElectronicAddressRole .ElectronicAddress
join LogisticsLocationRole on LogisticsElectronicAddressRole.LocationRole = LogisticsLocationRole .RecId
join DIRPARTYTABLE on VENDTABLE.PARTY = DIRPARTYTABLE.RECID
where LogisticsElectronicAddress.TYPE = 2 // address 1 is phone number
// where LogisticsElectronicAddress.ISPRIMARY = 1 // for primary contacts only // 0 for non primary
order by VENDTABLE.ACCOUNTNUM