Hello,
I have a extrange problem.
Usually when I want to use a line break I use
& vbNewLine &
& vbLf &
& Chr(13)&
Always works, but now the email recieved is just a line without line breaks.
This is the code: ( The code works fine, just the line breaks)
Anyone knows this problem?
I have a extrange problem.
Usually when I want to use a line break I use
& vbNewLine &
& vbLf &
& Chr(13)&
Always works, but now the email recieved is just a line without line breaks.
This is the code: ( The code works fine, just the line breaks)
Code:
Private Sub picemail_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles picemail.Click
Dim SmtpServer As New SmtpClient()
Dim mail As New MailMessage()
Dim eMensaje, ePie As String
Dim eTo, eNuestroCorreo, eNuestraContraseña As String
'Comenzamos el envio del correo
'controlando si existiera algún error al envío
Try
eNuestroCorreo = "lutonian29@hotmail.com"
eNuestraContraseña = password
eMensaje = "Hola " + txtnombre.Text + " ," & vbNewLine & vbNewLine & "Esta es una factura automática por el transporte de pan." & vbNewLine & vbNewLine & _
"He recibido la cantidad de " + TXTcantidad.Text + " por el concepto de " + TXTConcepto.Text + " con un precio total de " + TXTpreciototal.Text + vbNewLine & vbNewLine & "Fecha : " + TXTfecha.Text
'El Footer del Mensaje
ePie = "Transporte de Pan" & Chr(13) & Chr(10) & "islafran_3@hotmail.com"
eTo = emailmodulo
SmtpServer.Port = 25
SmtpServer.Host = "smtp.live.com"
SmtpServer.EnableSsl = True
SmtpServer.Credentials = New Net.NetworkCredential _
(eNuestroCorreo, eNuestraContraseña)
mail = New MailMessage()
mail.From = New MailAddress(eNuestroCorreo)
mail.To.Add(eTo)
mail.Subject = "Recibo numero " + txtrecibo.Text + " por entrega de pan."
mail.Body = eMensaje & ePie
mail.IsBodyHtml = True
'Le decimos que envíe el correo
SmtpServer.Send(mail)
'Msgbox dando el Ok del envío
MsgBox("Correo enviado a " + nombremodulo + ", Email: " + emailmodulo)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub