Retrieve recipient's SMTP server address via DNS lookup
[Syntax] Visual C++: HRESULT GetEmailServer(BSTR EmailAddr, BSTR* pVal) Visual Basic: GetEmailServer(EmailAddr As String) As String
Parameters
Return Value
Remarks
Example
[VB6, VBA - Query MX Record and Send Email]
Private Sub SendEmailByDns()
Dim oSmtp As New EASendMailObjLib.Mail
oSmtp.LicenseCode = "TryIt"
Dim Server As String
'Retrieve SMTP server address
Server = oSmtp.GetEmailServer("dennis@email.com" )
oSmtp.ServerAddr = Server
oSmtp.AddRecipient "Dennis", "Dennis@email.com", 0
...
End Sub
See Also
Send Email without SMTP server(DNS lookup)
ServerAddr Property
ImportMailEx Method