Authenticate through SMTP

Oct 28 2006 4:24 PM
This is driving me crazy! I've been able to relay through my office SMTP server, but I can't use vb.net to authenticate properly through my mailserver at home. I use Kerio Mailserver and my whole family relays through it, but I can't get vb to do it. Here's a sample --

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


Answers (1)