Email

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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.
 
* "=?Utf-8?B?Uml0YUs=?= 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.

I posted a pointer in the other group. Please don't mutlipost.
 
Hi Bart,

For this one you need an account on
lSMTPmsg.SmtpServer = "smtp.skynet.be"

:-)

For the OP in this place your smtp account, on that server the post will be
handled when they allow you to do that better is to use your own smtp server
when you have that..

And as advise to Bart do not set your email adress in a message.

Cor
 
Hi Herfried,

I searched microsoft.public, however I could not find "other group" is that
a restricted newsgroup?

:-)

Cor
 
It was something I used for an excercise as i followed a course on .Net.

The email in my message was closed as soon as we finished the course.
 
* "Cor Ligthert said:
I searched microsoft.public, however I could not find "other group" is that
a restricted newsgroup?

The OP knows -- I assume it's the Windows Forms group.
 
Thanks Bart,

I have been trying very similar code. According to Microsoft if you omit the SMPT server, it should revert to the local SMPT server. When I do this, the message goes into email never never land without any error message. Do I HAVE TO code in the server name?
 
That i couldn't say.
I have put the server name in the config-file.

RitaK said:
Thanks Bart,

I have been trying very similar code. According to Microsoft if you omit
the SMPT server, it should revert to the local SMPT server. When I do this,
the message goes into email never never land without any error message. Do
I HAVE TO code in the server name?
 
Back
Top