Could anyone point me in the right direction to solve this. I have three different textboxes on my form. What I am trying to do is send the inputs the user puts into the text boxes in an email. I have the email working but all the text is run together. I would like to have the inputs from the different textboxes to be on seperate lines.
Here is the code I have. Thanks for any help.
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim mymailmsg As New MailMessage
Try
mymailmsg.From = New MailAddress("gdy3eg3oyge@gmail.com")
mymailmsg.To.Add("jhdiwueho2@aol.com")
mymailmsg.Subject = "Waste Report"
mymailmsg.Body = TextBox1.Text + TextBox2.Text + Textbox3.Text<------------here is my problem but I don't know how to fix
Dim smtp As New SmtpClient("smtp.gmail.com")
smtp.Port = 587
smtp.EnableSsl = True
smtp.Credentials = New System.Net.NetworkCredential("jewhdepiuh@gmail.com", "kjoqwijs")
smtp.Send(mymailmsg)
MsgBox("Sent")
Catch ex As Exception
End Try
End Sub
Here is the code I have. Thanks for any help.
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim mymailmsg As New MailMessage
Try
mymailmsg.From = New MailAddress("gdy3eg3oyge@gmail.com")
mymailmsg.To.Add("jhdiwueho2@aol.com")
mymailmsg.Subject = "Waste Report"
mymailmsg.Body = TextBox1.Text + TextBox2.Text + Textbox3.Text<------------here is my problem but I don't know how to fix
Dim smtp As New SmtpClient("smtp.gmail.com")
smtp.Port = 587
smtp.EnableSsl = True
smtp.Credentials = New System.Net.NetworkCredential("jewhdepiuh@gmail.com", "kjoqwijs")
smtp.Send(mymailmsg)
MsgBox("Sent")
Catch ex As Exception
End Try
End Sub
Last edited: