You could try this :
Private Sub CreateConfirmationMail(ByVal vstrEmail As String, ByVal
vstrUserName As String, ByVal vstrPassword As String)
Try
Dim lSMTPmsg As System.Web.Mail.SmtpMail
Dim lmsg As New System.Web.Mail.MailMessage()
'Create the mail
lmsg.To = vstrEmail.Trim
lmsg.From = "(e-mail address removed)"
lmsg.Subject = "Your Subscription"
lmsg.Body = "Thank you for your subscription." & vbCrLf
lmsg.Body &= "Hereby we sent you your username and password." &
vbCrLf
lmsg.Body &= "Username = " & vstrUserName.Trim & vbCrLf
lmsg.Body &= "Password = " & vstrPassword.Trim & vbCrLf
lmsg.Body &= "You can change these the next time you logon and go to
the userinfo."
lSMTPmsg.SmtpServer = "smtp.skynet.be"
'Send the mail
lSMTPmsg.Send(lmsg)
MessageBox.Show("Password has been sent.", "Send Newsletter",
MessageBoxButtons.OK, MessageBoxIcon.Information)
Catch ex As Exception
Throw ex
End Try
End Sub
RitaK said:
I'm new to windows programming using vb.net. I want to send a simple
email from my app to register the software. What is the easiest way to do
this without knowing what email program is on the users machine. Any
pointers would be appreciated.