Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/02/2014, 11:00
Fer2013
 
Fecha de Ingreso: noviembre-2013
Mensajes: 18
Antigüedad: 11 años, 3 meses
Puntos: 0
Error al enviar email

Hola.

Tengo un codigo que adjunto para enviar emails desde mi pagina aspx, solamente funciona con el dominio de mi empresa y si pongo algún dominio exterior obtengo este mensaje.
Mailbox unavailable. The server response was: 5.7.1 Unable to relay

Alguna idea?

Código ASP:
Ver original
  1. Dim smtpserver As New SmtpClient("127.0.0.1")
  2.         ' smtpserver.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis
  3.         Dim mail As New MailMessage()
  4.         smtpserver.Credentials = New Net.NetworkCredential("[email protected]", "A34hf1o55toog")
  5.         smtpserver.Port = 25
  6.         smtpserver.Host = "mail.midominio.com"
  7.         mail = New MailMessage()
  8.         mail.From = New MailAddress("[email protected]")
  9.         mail.To.Add("[email protected]")
  10.         mail.Subject = "Propuesta económica" & "  Número:  " & TextIDPropuesta.Text
  11.         mail.Body = "Tal como hemos estado comentado le adjunto propuesta económica :"
  12.  
  13.         ' Dim att As New System.Net.Mail.Attachment("RUTAARCHIVO.EXT")
  14.         If FileUpload1.HasFile Then
  15.  
  16.             Dim MyFile As String = System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName)
  17.             Dim attachmentFile As New Attachment(FileUpload1.PostedFile.InputStream, MyFile)
  18.             mail.Attachments.Add(attachmentFile)
  19.  
  20.         End If
  21.      
  22.         smtpserver.Send(mail)
  23.         Response.Write("<script language='JavaScript'>alert('Mensaje enviado correctamente...!!!');</script>")