|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Designing Email Msg.I have a small form build with visual studio 2005 (Visual Basic) in that form i have some text boxes and some combos. these are being field by the users followed by an mail submit button i created using a snipet. the button code: Private Sub butmail_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butmail.Click Dim body As String = Me.DateTimePicker1.Text() Dim message As New MailMessage("***@aaa.com", "a**@aaa.com", "Computer Notice", body) Dim emailClient As New SmtpClient("aaa.aaa.aaa") emailClient.Send(message) End Sub End Class Now, the email does arrive containing the data that the user typed in the fields, but the data comes as a stright string with no spaces in the msg body. im looking to understand how can i design the way the msg arrived at the email box. lets say for example.. name: the data owner: the data last upgrade: data etc... bare in mind that it took me ages to perform this small form :) i have no idea in programing what so ever, just following the logic... so code samples would be greatly appriciated! thanks for everything! 50. On May 3, 5:23 am, 5070***@gmail.com wrote:
Show quoteHide quote > Hi all! How about:> > I have a small form build with visual studio 2005 (Visual Basic) > in that form i have some text boxes and some combos. > these are being field by the users followed by an mail submit button i > created using a snipet. > > the button code: > > Private Sub butmail_Click_1(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles butmail.Click > Dim body As String = Me.DateTimePicker1.Text() > Dim message As New MailMessage("a***@aaa.com", "a***@aaa.com", > "Computer Notice", body) > Dim emailClient As New SmtpClient("aaa.aaa.aaa") > emailClient.Send(message) > > End Sub > End Class > > Now, the email does arrive containing the data that the user typed in > the fields, > but the data comes as a stright string with no spaces in the msg body. > > im looking to understand how can i design the way the msg arrived at > the email box. > lets say for example.. > > name: the data > owner: the data > last upgrade: data > etc... > > bare in mind that it took me ages to perform this small form :) i have > no idea in programing what so ever, just following the logic... > so code samples would be greatly appriciated! > > thanks for everything! > > 50. ' Typed in message Private Sub butmail_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butmail.Click Dim body As String = String.Format("<b>Name: </b>{0}<br />", Me.NameTextBox.Text) body &= String.Format("<b>Owner: </b>{0} <br />", Me.OwnerTextBox.Text) body &= String.Format("<b>Last Upgrade: </b>{0} <br />", Me.LastUpgradeTextBox.Text) ' etc Dim message As New MailMessage("a***@aaa.com", "a***@aaa.com", "Computer Notice", body) message.IsBodyHtml = True Dim emailClient As New SmtpClient("aaa.aaa.aaa") emailClient.Send(message) End Sub End Class Thanks, Seth Rowe On May 3, 12:39 pm, rowe_newsgroups <rowe_em***@yahoo.com> wrote:
Show quoteHide quote > On May 3, 5:23 am, 5070***@gmail.com wrote: Seth!!! Thank you so much!!!> > > > > > > Hi all! > > > I have a small form build with visual studio 2005 (Visual Basic) > > in that form i have some text boxes and some combos. > > these are being field by the users followed by an mail submit button i > > created using a snipet. > > > the button code: > > > Private Sub butmail_Click_1(ByVal sender As System.Object, ByVal e As > > System.EventArgs) Handles butmail.Click > > Dim body As String = Me.DateTimePicker1.Text() > > Dim message As New MailMessage("a***@aaa.com", "a***@aaa.com", > > "Computer Notice", body) > > Dim emailClient As New SmtpClient("aaa.aaa.aaa") > > emailClient.Send(message) > > > End Sub > > End Class > > > Now, the email does arrive containing the data that the user typed in > > the fields, > > but the data comes as a stright string with no spaces in the msg body. > > > im looking to understand how can i design the way the msg arrived at > > the email box. > > lets say for example.. > > > name: the data > > owner: the data > > last upgrade: data > > etc... > > > bare in mind that it took me ages to perform this small form :) i have > > no idea in programing what so ever, just following the logic... > > so code samples would be greatly appriciated! > > > thanks for everything! > > > 50. > > How about: > > ' Typed in message > Private Sub butmail_Click_1(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles butmail.Click > Dim body As String = String.Format("<b>Name: </b>{0}<br />", > Me.NameTextBox.Text) > body &= String.Format("<b>Owner: </b>{0} <br />", > Me.OwnerTextBox.Text) > body &= String.Format("<b>Last Upgrade: </b>{0} <br />", > Me.LastUpgradeTextBox.Text) > ' etc > Dim message As New MailMessage("a***@aaa.com", > "a***@aaa.com", > "Computer Notice", body) > message.IsBodyHtml = True > Dim emailClient As New SmtpClient("aaa.aaa.aaa") > emailClient.Send(message) > End Sub > End Class > > Thanks, > > Seth Rowe- Hide quoted text - > > - Show quoted text - Works great!!! could i bother you with one lastttttt question?! how can i popup a dialog box after the user pressed the button "Email Sent!" and clear the form for next data? 50. > could i bother you with one lastttttt question?! Hey that's two questions! :-)> > how can i popup a dialog box after the user pressed the button "Email > Sent!" and clear the form for next data? If MessageBox.Show("Do you want to clear the form?", "Clear Form?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Then ' There are other ways to clear the text properties ' of every control on the form than clearing them ' individually, but since you are just starting you ' might want to stick with this simple approach Me.TextBox1.Text = "" Me.TextBox2.Text = "" Me.TextBox3.Text = "" ' etc End If Thanks, Seth Rowe On May 3, 1:11 pm, rowe_newsgroups <rowe_em***@yahoo.com> wrote:
Show quoteHide quote > > could i bother you with one lastttttt question?! "Hey that's two questions! :-)" -> why stick to semantics ? :)> > > how can i popup a dialog box after the user pressed the button "Email > > Sent!" and clear the form for next data? > > Hey that's two questions! :-) > > If MessageBox.Show("Do you want to clear the form?", "Clear > Form?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = > Windows.Forms.DialogResult.Yes Then > ' There are other ways to clear the text properties > ' of every control on the form than clearing them > ' individually, but since you are just starting you > ' might want to stick with this simple approach > Me.TextBox1.Text = "" > Me.TextBox2.Text = "" > Me.TextBox3.Text = "" > ' etc > End If > > Thanks, > > Seth Rowe should i just paste this under the button code? On May 3, 1:11 pm, rowe_newsgroups <rowe_em***@yahoo.com> wrote:
Show quoteHide quote > > could i bother you with one lastttttt question?! Works like a charm!> > > how can i popup a dialog box after the user pressed the button "Email > > Sent!" and clear the form for next data? > > Hey that's two questions! :-) > > If MessageBox.Show("Do you want to clear the form?", "Clear > Form?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = > Windows.Forms.DialogResult.Yes Then > ' There are other ways to clear the text properties > ' of every control on the form than clearing them > ' individually, but since you are just starting you > ' might want to stick with this simple approach > Me.TextBox1.Text = "" > Me.TextBox2.Text = "" > Me.TextBox3.Text = "" > ' etc > End If > > Thanks, > > Seth Rowe so much thanks seth!! 50.
Add custom button on title bar
Threading(?) & FileSystemWatcher fax question Bundle csv files Output Ascii 0x02 as part of record How to create generic object at run-time? adding xml data to a combobox Database Connection Speed Issue. I'm stumped! Would like to see the Generated code in visual studio 2005 Check if string contain Uppercase. |
|||||||||||||||||||||||