Hello
i'm trying to send a simple email via vb.net code, my problem is that i can't break the line and i manage only to send one line in the body of the mail
when i dissplay my string in a message box, i can see the line break (got 2 lines in the message) but when sending this string to the mail i got only one line
this is my code:
Private
Function Send_Mail(ByVal Subject_to_send As String, ByVal String_to_send As String)
Dim EmailTo As String
EmailTo1 =
"my Email Address"
Dim startInfo As New ProcessStartInfo
Console.WriteLine(
"sending mail...")
Dim Smtp_Server As New SmtpClient
Dim e_mail As New MailMessage()
Smtp_Server.UseDefaultCredentials =
False
Smtp_Server.Port = 25
Smtp_Server.EnableSsl =
False
Smtp_Server.Host =
"email host address"
e_mail =
New MailMessage()
e_mail.From =
New MailAddress(From@com)
e_mail.To.Add(EmailTo)
e_mail.Subject = Subject_to_send
e_mail.IsBodyHtml =
False
e_mail.Body = String_to_send
Smtp_Server.Send(e_mail)
Environment.Exit(2)
Return 0
End Function
no matter what i put in String_to_send (i try vbCrLf/vbNewLine) i can't get it to send 2 lines in the mail...
any suggestions?
thanks
i'm trying to send a simple email via vb.net code, my problem is that i can't break the line and i manage only to send one line in the body of the mail
when i dissplay my string in a message box, i can see the line break (got 2 lines in the message) but when sending this string to the mail i got only one line
this is my code:
Private
Function Send_Mail(ByVal Subject_to_send As String, ByVal String_to_send As String)
Dim EmailTo As String
EmailTo1 =
"my Email Address"
Dim startInfo As New ProcessStartInfo
Console.WriteLine(
"sending mail...")
Dim Smtp_Server As New SmtpClient
Dim e_mail As New MailMessage()
Smtp_Server.UseDefaultCredentials =
False
Smtp_Server.Port = 25
Smtp_Server.EnableSsl =
False
Smtp_Server.Host =
"email host address"
e_mail =
New MailMessage()
e_mail.From =
New MailAddress(From@com)
e_mail.To.Add(EmailTo)
e_mail.Subject = Subject_to_send
e_mail.IsBodyHtml =
False
e_mail.Body = String_to_send
Smtp_Server.Send(e_mail)
Environment.Exit(2)
Return 0
End Function
no matter what i put in String_to_send (i try vbCrLf/vbNewLine) i can't get it to send 2 lines in the mail...
any suggestions?
thanks