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?

