Sending an email using SMTP throws a "Mailbox unavailable. The server response was: Too many invalid recipients" Error

Hi there,
i'm trying to send an email with the code below. The thing is that i keep getting this error "Mailbox unavailable. The server response was: Too many invalid recipients" is there something i'm missing?
I'm using VS 2008
Thanks,
COHFL
Public Shared Sub SendNotificationEmail(ByVal emailer As String, ByVal MessageSubject As String, ByVal MessageBody As String)

            'create the mail message
            Dim mail As New Net.Mail.MailMessage()

            'set the addresses
            mail.From = New Net.Mail.MailAddress("username@domain.com")'this email address does exist
            mail.To.Add("username@domain.com") 'this email does exits
            'set the content
            mail.Subject = MessageSubject & " " & Now.ToShortDateString
            mail.Body = MessageBody

            Try
                'set the server to be used
                Dim smtp As New Net.Mail.SmtpClient("mx1.server.com") 
                'send the message
                smtp.Send(mail)
            Catch ex As Exception
                Throw ex.InnerException
            End Try

        End Sub

Open in new window

COHFLAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hesCommented:
After the
 Dim smtp As New Net.Mail.SmtpClient("mx1.server.com")
Try adding in
smtp.Credentials = New System.Net.NetworkCredential("username", "password")  
0
COHFLAuthor Commented:
those credential should be the sender credential right?
0
COHFLAuthor Commented:
if the credential are the sender, still not luck. I get the same error
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

pschramaCommented:
Sounds like the mailserver you are using only accepts mail for its domain and it's not a mail relay used for outbound mail. Are you sure there isn't a separate mailserver for outgoing mail?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Kumaraswamy RCommented:
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.