System.net.mail problem

Hi everyone, I have a little problem using the system.net.mail namespace implemented in the following code:

PrivateSub Envio_Correo(ByVal rutaAsString)

'Creando la instancia del mensaje

Dim correoAs new MailMessage

correo.From =New MailAddress("b98123839@usmp.edu.pe")

correo.To.Add("amonasiq@usmp.edu.pe")

correo.Subject ="Archivo de Confirmación de matricula"

correo.Body ="Se adjunto archivo de confirmación de matricula de su respectiva facultad"

correo.IsBodyHtml =False

'correo.Attachments.Add(New Attachment(ruta))

correo.Priority = MailPriority.Normal

'Crando la instancia del SMTP cliente

Dim smtpAsNew SmtpClient

smtp.Host ="134.5.6.84"

Try

smtp.Send(correo)

Catch exAs SmtpException

lMenErr.Text ="Paso 4: Enviando el correo: " + ex.Message.ToString()

lMenErr.ForeColor = System.Drawing.Color.Red

EndTry

EndSub

But always get the same error: Mailbox unavailable. The server response was: Error: Message content rejected

But if i use the namespace system.web.mail from framework 1.1 with almost the same code:

PrivateSub enviar_correo_antiguo(ByVal rutaAsString,ByVal facuAsString)

Dim correoAsNew MailMessage

Dim adjuntoAsNew MailAttachment(ruta)

correo.From ="desarrollo@usmp.edu.pe"

correo.To = Devolver_mail_ora(facu)

correo.Subject ="Archivo de Confirmación de matricula"

correo.Body ="Se adjunto archivo de confirmación de matricula de su respectiva facultad"

correo.Attachments.Add(adjunto)

SmtpMail.SmtpServer ="134.5.6.84"

Try

SmtpMail.Send(correo)

Catch exAs Exception

lMenErr.Text ="Paso 5: Enviando el correo: " + ex.Message.ToString()

lMenErr.ForeColor = System.Drawing.Color.Red

EndTry

EndSub

I dont have any problem at all, Could anyone tell me what is wrong in my code?

[5282 byte] By [Kryor] at [2007-12-23]
# 1

In your testing are you absolutly sure that the email addresses are the same? In this example at least they do not appear to be.

Other things to check into would be if the server you are trying to send to is having to relay the message to another server or if where you are sending from (or just the address/domain) of the From account is blacklisted by the server.

BrendanGrant at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 2

both addresses are valid ones, the server.host is the same smtp server and neither of those emails address are blacklisted.

Kryor at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 3

What is the filetype of the attachment you are trying to send in the second example (but commented out in the first)? Could it be that the server is unwilling to accept an attachment of that type?

BrendanGrant at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 4

the filetype is a xls, but the error happens even if comment the attach part.

Kryor at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...

.NET Development

Site Classified