Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SMTP Authentication problem

2 views
Skip to first unread message

eruth

unread,
May 12, 2008, 11:26:54 AM5/12/08
to
Hi all,

I'm trying to send an e-mail from a vb.net web form. I can create the
message, but when it comes to actually sending it I get the following
error. "Mailbox name not allowed. The server response was: Server
policy dictates you must authenticate first "

So far as I can tell, my code is doing what it's meant to, but I'd
appreciate someone casting an eye over it to make sure. This is based
on a couple of examples found through google.
<code>
Dim Message As MailMessage = New MailMessage()
Dim Smtp As New SmtpClient()
Dim SmtpUser As New System.Net.NetworkCredential()
'-- Build Message
Message.From = New MailAddress("m...@mydomain.co.uk", "Me")
Message.To.Add(New MailAddress("y...@mydomain.co.uk", "you"))
Message.IsBodyHtml = False
Message.Subject = "test"
Message.Body = "This is a test"
'-- Define Authenticated User
SmtpUser.UserName = "user"
SmtpUser.Password = "password"
SmtpUser.Domain = "mydomain.co.uk"
'-- Send Message
Smtp.UseDefaultCredentials = False
Smtp.Credentials = SmtpUser
Smtp.Host = "mydomain.co.uk"
Smtp.Port = 25
Smtp.DeliveryMethod = SmtpDeliveryMethod.Network
Smtp.Send(Message)
</code>

Madhur

unread,
May 12, 2008, 2:08:59 PM5/12/08
to
The error message suggests that mydomain.co.uk is asking for SMTP
authentication.

Are you sure that particular SMTP can relay email messages without
authentication.

--
MAdhur

"eruth" <emma.p...@gmail.com> wrote in message
news:cf336392-889d-4122...@34g2000hsh.googlegroups.com...

eruth

unread,
May 13, 2008, 4:18:43 AM5/13/08
to
If authentication is turned off, the mail can be sent, but as soon as
we turn it back on, I get that message.

On May 12, 7:08 pm, "Madhur" <s...@df.com> wrote:
> The error message suggests that mydomain.co.uk is asking for SMTP
> authentication.
>
> Are you sure that particular SMTP can relay email messages without
> authentication.
>
> --
> MAdhur
>

> "eruth" <emma.pearl...@gmail.com> wrote in message

Madhur

unread,
May 13, 2008, 8:36:58 AM5/13/08
to
Check if your authentication requires some security encryption.

"eruth" <emma.p...@gmail.com> wrote in message

news:6721bbe3-bdf9-4783...@m73g2000hsh.googlegroups.com...

eruth

unread,
May 21, 2008, 9:52:12 AM5/21/08
to
On May 13, 1:36 pm, "Madhur" <s...@df.com> wrote:
> Check if your authentication requires some security encryption.
>

Turns out all this was caused not by my code, but by the SMTP server
not being configured correctly. Nice to know it wasn't me though ;)

0 new messages