Hola a todos, les comento algo que estoy experimentando y no encuentro la solución. Utilizo el siguiente código para mandar un mail desde el hosting hacia una dirección externa:
sub Page_Load(sender as Object, e as EventArgs)
Dim msg as New MailMessage()
msg.To = "
[email protected]"
msg.From = "
[email protected]"
msg.Subject = "Prueba News Letter Automática"
Dim st as New cStrLayout
st.fText
msg.Body = st.strFull
SmtpMail.SmtpServer = "mail.prensaenlinea.net"
msg.BodyFormat = MailFormat.Html
SmtpMail.Send(msg)
response.Write("Enviado a: " & msg.to)
msg = Nothing
End Sub
con este código el error es el siguiente:
The server rejected one or more recipient addresses. The server response was: 550 <
[email protected]> No such user here
He probado con este otro código:
sub Page_Load(sender as Object, e as EventArgs)
Dim msg as New MailMessage()
msg.To = "
[email protected]"
msg.From = "
[email protected]"
msg.Subject = "Prueba News Letter Automática"
Dim st as New cStrLayout
st.fText
msg.Body = st.strFull
SmtpMail.SmtpServer = "mail.prensaenlinea.net"
Msg.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
Msg.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 Msg.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "
[email protected]"
Msg.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "*******"
msg.BodyFormat = MailFormat.Html
SmtpMail.Send(msg)
response.Write("Enviado a: " & msg.to)
msg = Nothing
End Sub
con este código no hay errores de ningún tipo, pero los mails no llegan a destino, eso es lo extraño.
Si alguien sabe qué puede pasar, le agradezco mucho.
Saludos.