Dim MailClient As New System.Net.Mail.SmtpClient
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.MailClient.Host = "xxxx.xxx"
Me.MailClient.Port = "25"
Dim MyCred As New System.Net.NetworkCredential("[email protected]", "xxxxxxx")
MailClient.UseDefaultCredentials = False
MailClient.Credentials = MyCred
MailClient.Send("[email protected]", "[email protected]", "[Test]- VB App", "VB App")
End Sub
Now, when I try to send an email to a email address on the mailserver, it works fine. But when trying to send to for example, a Gmail or Yahoo account, it will not - says 'Cannot Relay'. Yes, the user I'm authenticating with does have permission to relay....
Thanks!
Brandon