He echo lo siguiente:
Código vb.net:
Ver originalProtected Sub enviarEmail(ByVal email As String)
Dim a, b, c, d, f, g, h As String
Try
'* Creamos un Objeto tipo Mail
Dim objMail As Outlook.MailItem
'* Inicializamos nuestra apliación OutLook
m_OutLook = New Outlook.Application
'* Creamos una instancia de un objeto tipo MailItem
objMail = m_OutLook.CreateItem(Outlook.OlItemType.olMailItem)
'* Asignamos las propiedades a nuestra Instancial del objeto
'* MailItem
'objMail.From = New System.Net.Mail.MailAddress(emailRemitente, emailRemitente, System.Text.Encoding.UTF8) 'Quien lo envía
objMail.To = email
objMail.Subject = "Hoja de gastos rechazada"
Dim values As String = ""
For i As Integer = 0 To CheckBoxRechazo.Items.Count - 1
If CheckBoxRechazo.Items(i).Selected Then
If CheckBoxRechazo.Items(i).Value = 1 Then
a = uno
End If
If CheckBoxRechazo.Items(i).Value = 2 Then
b = dos
End If
If CheckBoxRechazo.Items(i).Value = 3 Then
c = tres
End If
If CheckBoxRechazo.Items(i).Value = 4 Then
d = cuatro
End If
If CheckBoxRechazo.Items(i).Value = 5 Then
f = cinco
End If
If CheckBoxRechazo.Items(i).Value = 6 Then
g = seis
End If
End If
Next
h = TextObservacionesLG.Text
objMail
.Body = a
+ Chr(13) + b
+ Chr(13) + c
+ Chr(13) + d
+ Chr(13) + f
+ Chr(13) + g
+ Chr(13) + h
'Prioridad del correo
objMail.Priority = System.Net.Mail.MailPriority.Normal
'Host=nombre del servidor de correo por el que queremos enviar el mensaje
Dim smtp As New System.Net.Mail.SmtpClient
smtp.Host = "192.168.1.131"
'Si el servidor de correo necesita autenticación
'smtp.Credentials = New System.Net.NetworkCredential("usuario", "password")
'* Enviamos nuestro Mail y listo!
smtp.Send(objMail)
Label2.Text = "ENVIADO"
'* Desplegamos un mensaje indicando que todo fue exitoso
'MsgBox("Mail Enviado. Integración con OutLook")
Catch ex As Exception
Label2.Text = "NO ENVIADO"
'* Si se produce algun Error Notificar al usuario
'MsgBox("Error enviando mail " + ex.Message)
Finally
m_OutLook = Nothing
Response.Redirect("Identificador.aspx")
End Try
End Sub
No se si esta bien por que no consigo mandar ningún mail .
Me podeis ayudar??