First off, I am a noob.
I workfor a printshop that screenprints customized hats,tees and a host of other stufffor a variety of small businesses. Being that we are a small business as well, we can't afford to mass ship catalogs to our clients, so I decided to builda catalog application/business card that can be emailed to them.
Theapp is rep. specific, and after choosing which options suit them best using text fields and combo boxes,upon clicking submit, the customers' info is emailed to the rep.
To do this, I am trying to get a popup window thatdisplays an email form with the 'mailto' address previously set, so it can't be altered and the info from the previous screen to be pasted in the body of the email. Upon clicking the confirm button, the mail is sent and the window is closed.I already have the code to copy the info from the textbox and combobox entries and paste it into theemail bodyin the next form, but getting the email form to be functional is appearing to be quite a feet.
How do I bind this to the send button?
here is the code I am using.
Imports
System.Net.Mail
Public
Class Form2
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End Sub
Public Sub StartDefaultMail(ByVal sTo As String, _
Optional ByVal sSubject As String = "", _
Optional ByVal sMessage As String = "")
Try
sTo = UrlEncode(sTo)
sSubject = sSubject
sMessage = sMessage
Process.Start("mailto:gothickfish@yahoo.com" & sTo & "?subject=" _
& sSubject &
"&body=" & sMessage)
Catch e As Exception
MsgBox(
"Couldn't start default email application" _
& vbCrLf & e.Message)
'or
Throw New Exception("Couldn't start default email app", e)
End Try
End Sub
Private Function UrlEncode(ByVal sTo As String) As String
Throw New NotImplementedException
End Function
End
Class