02-28-2010, 03:10 AM
I haven't coded in ages and am only just getting back into it.
I thought I would just much around with a few functions that everyone seems to use in their programs as a bit of a slow start back into it. I seem to be doing pretty well so far, especially seeing as vb.net is a bit different for me (learnt on vb6).
Anyway, I was messing with the e-mail function... and I could only add one textbox value to the body. Here is the code I'm trying to use:
I want to add more text boxes on Mail.body, but can't figure out how to do it. I just keep creating syntax errors.
Does anyone know how to do this?
I thought I would just much around with a few functions that everyone seems to use in their programs as a bit of a slow start back into it. I seem to be doing pretty well so far, especially seeing as vb.net is a bit different for me (learnt on vb6).
Anyway, I was messing with the e-mail function... and I could only add one textbox value to the body. Here is the code I'm trying to use:
Code:
Dim Mail As New MailMessage
Mail.Subject = txtUser.Text
Mail.To.Add(txtGMAILUser.Text)
Mail.From = New MailAddress(txtGMAILUser.Text)
Mail.Body = txtName.Text
Dim SMTP As New SmtpClient("smtp.gmail.com")
SMTP.EnableSsl = True
SMTP.Credentials = New System.Net.NetworkCredential(txtGMAILUser.Text, txtGMAILPass.Text)
SMTP.Port = 587
SMTP.Send(Mail)
I want to add more text boxes on Mail.body, but can't figure out how to do it. I just keep creating syntax errors.
Does anyone know how to do this?