4 Replies - 12105 Views - Last Post: 13 January 2009 - 05:45 AM Rate Topic: -----

#1 michael smith  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 3
  • Joined: 11-November 08

using mailto in vb 2005

Posted 11 January 2009 - 05:24 AM

OK I have never used mailto: before in VB but have used it many time in html. Now I tried to use it to send a simple email from the default email client. But on trying to build I get build errors refering to my mailto address.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
		datastream = (TextBox1.Text & "," & TextBox2.Text & "'" & TextBox3.Text & "'" & TextBox4.Text & "'" & TextBox5.Text & "'" & TextBox6.Text & "'" & key)
		 mailto:zipper@gmail.com?subject=blackControlv1.0.0;&body=datastream 
	End Sub


Error 1 Name 'zipper' is not declared.
Error 2 Method arguments must be enclosed in parentheses.
Error 3 Name 'gmail' is not declared.
Error 4 Character is not valid.

Now I can follow the link and it builds a email with the default email client(while editing the source code) but will not build the exe. I have seen the smtp examples however I would like to use the default email address and email client on the machine. The reason is that the client needs to have a valid email address for registration. On the failure of that I will use a smtp via another provider as a backup.

So what I am looking for is a method of using the default email client on the default email address of the user and including the built string "datastream"in the body.

I couldn't find a simple mailto: example for vb net.

Cheers
Michael Smith

Is This A Good Question/Topic? 0
  • +

Replies To: using mailto in vb 2005

#2 AdamR  Icon User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 144
  • Joined: 23-September 08

Re: using mailto in vb 2005

Posted 11 January 2009 - 07:23 AM

Using MailTo in vb 2005

:)
Was This Post Helpful? 1
  • +
  • -

#3 citricube  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 73
  • Joined: 21-January 08

Re: using mailto in vb 2005

Posted 11 January 2009 - 03:34 PM

I actually made an email program a while back you could prob learn from it

Download
Was This Post Helpful? 1
  • +
  • -

#4 michael smith  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 3
  • Joined: 11-November 08

Re: using mailto in vb 2005

Posted 12 January 2009 - 04:23 AM

View Postcitricube, on 11 Jan, 2009 - 02:34 PM, said:

I actually made an email program a while back you could prob learn from it

Download

Thank you both AdamR and citricube, I will have a good look at both, and it was very kind to share you email program I am sure I will learn a lot from it.

Thanks again
Michael Smith
Was This Post Helpful? 0
  • +
  • -

#5 michael smith  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 3
  • Joined: 11-November 08

Re: using mailto in vb 2005

Posted 13 January 2009 - 05:45 AM

View Postmichael smith, on 12 Jan, 2009 - 03:23 AM, said:

View Postcitricube, on 11 Jan, 2009 - 02:34 PM, said:

I actually made an email program a while back you could prob learn from it

Download

Thank you both AdamR and citricube, I will have a good look at both, and it was very kind to share you email program I am sure I will learn a lot from it.

Thanks again
Michael Smith

OK here is my code, short, sweet and works great.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
		datastream = (TextBox1.Text & "," & TextBox2.Text & "'" & TextBox3.Text & "'" & TextBox4.Text & "'" & TextBox5.Text & "'" & TextBox6.Text & "'" & key)
		maileraddy = ("mailto:" & address & "?" & "subject=Black Control;" & "&body=" & datastream)
		System.Diagnostics.Process.Start(maileraddy)

	End Sub


It gathers the address to send to, and pulls the data from the the text boxes bunches them up into a string and places them in the body of the mail message.

Thanks for the help
Kind Regards
Michael Smith
:D
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1