Visual Basic .NET Forums  

Go Back   Visual Basic .NET Forums > VB.NET > VB.NET General Discussion

VB.NET General Discussion VB.NET general discussion area

VB.NET Forums Newsletter Signup:
Email address:


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-01-2008, 12:36 PM
VB.NET Forum Newbie
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Dec 2008
Posts: 20
Reputation: 10
ecaf is on a distinguished programming path ahead
Default Email in vb.net - questions?

Hi,
I'm new to Vb.net - I'm just setting up some sample applications to try and get a hang of it

I'm just wondering can you send emails with voting buttons in vb.net?
And if so can the response be sent back to the server and inserted into the database?
Can anyone direct me to some sample code on this? Or any articles that might help me?

Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 12-01-2008, 3:25 PM
VB.NET Forum Idol
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Feb 2008
Posts: 712
Reputation: 369
MattP VB.NET gold medalistMattP VB.NET gold medalistMattP VB.NET gold medalistMattP VB.NET gold medalistMattP VB.NET gold medalistMattP VB.NET gold medalistMattP VB.NET gold medalistMattP VB.NET gold medalistMattP VB.NET gold medalistMattP VB.NET gold medalistMattP VB.NET gold medalist
Default

Here's how to using Outlook Automation.

Code:
		Dim appOutlook As New Outlook.Application
		Dim mmOutlook As Outlook.MailItem = appOutlook.CreateItem(Outlook.OlItemType.olMailItem)

		With mmOutlook
			.To = "user@domain.com"
			.Subject = "Vote!"
			.Body = "Message Body"
			.VotingOptions = "Yes; No; Maybe So"
			.Send()
		End With

		mmOutlook = Nothing
		appOutlook = Nothing
I would advise that you send out an html email with links for each of the options.

Something like:

Code:
yoursite.com/vote.aspx?recipient=1234&vote=1
Your webapp can then do the insert/update on the database with the results and you'll only need to worry about users having to have html email capabilities.

Last edited by MattP; 12-01-2008 at 3:32 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 12-02-2008, 10:47 AM
cjard's Avatar
VB.NET Forum All-Mighty
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Apr 2006
Age: 65
Posts: 6,137
Reputation: 658
cjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond repute
Default

Eww.. Automation requires outlook, which costs money hence not guaranteed to exist. Try System.Net.Mail instead
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 12-02-2008, 10:56 AM
VB.NET Forum Newbie
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Dec 2008
Posts: 20
Reputation: 10
ecaf is on a distinguished programming path ahead
Default

Hi, maybe you could help me a little further?
So far I have managed to send an email from my app using System.Net.Mail.MailMessage
And I can send the email, but I wanted to add buttons to this message, like Approve / Decline - which would send a message back to the database and store which option was selected.

Now I have been searching on the web this morning on HTML forms in vb.net and things like this but I cannot get the information I have been looking for.
I used PHP before (for college) and I tried using this, which did work in that it put the buttons into the email being sent, but of course it didn't do anything else because I wasn't sure how to use the postback, and I don't really want to go down this route unless it is the only way to do it.

So is there a way to send a System.Net.Mail.MailMessage email with buttons in it, and can you direct me to a tutorial or something for this?
Can I get it to put the value of the button selected into the database?

Sorry this might seem like silly questions, but when your just learning it's difficult to find where to start.
Thanks for answers so far.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 12-02-2008, 11:43 AM
cjard's Avatar
VB.NET Forum All-Mighty
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Apr 2006
Age: 65
Posts: 6,137
Reputation: 658
cjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond repute
Default

Of course; you can form an HTML page and send it in the mail, the HTML can contain a FORM whose target is your php page, and thus the buttons would cause POST data values to be submitted to the page. Even simpler, you can maybe just include links of the form:

<a href='http://myserver.com/mypage.php?id=1234&action=y'>Yes</a>
<a href='http://myserver.com/mypage.php?id=1234&action=n'>No</a>


Beware using images in emails; its a common trick by spammers to find out when/if a mail was viewed (your browser/client opens the mail, retrieves the image and the webserver logs the image retrieval thereby knowing your email address is valid and read. Outlook etc protect this by removing picture links until a "download pictures" option is chosen. Not cool for your purposes
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 12-02-2008, 11:52 AM
VB.NET Forum Newbie
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Dec 2008
Posts: 20
Reputation: 10
ecaf is on a distinguished programming path ahead
Default

Ok thanks, I will give this a try, I just hadn't made the form /php page to receive the response.
Hopefully I will start to get the hang of this soon!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 12-02-2008, 12:17 PM
VB.NET Forum Idol
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Feb 2008
Posts: 712
Reputation: 369
MattP VB.NET gold medalistMattP VB.NET gold medalistMattP VB.NET gold medalistMattP VB.NET gold medalistMattP VB.NET gold medalistMattP VB.NET gold medalistMattP VB.NET gold medalistMattP VB.NET gold medalistMattP VB.NET gold medalistMattP VB.NET gold medalistMattP VB.NET gold medalist
Default

Quote:
Originally Posted by ecaf View Post
Ok thanks, I will give this a try, I just hadn't made the form /php page to receive the response.
Hopefully I will start to get the hang of this soon!
Oh sure take the advice when cjard gives it
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 12-02-2008, 12:45 PM
VB.NET Forum Newbie
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Dec 2008
Posts: 20
Reputation: 10
ecaf is on a distinguished programming path ahead
Default

Quote:
Originally Posted by MattP View Post
Oh sure take the advice when cjard gives it
Yeah! I realised that it was the same as what you had written at the end of your post, I didn't know what to do with yours until I tried out the PHP stuff myself today!
I still don't know fully what I'm doing (I'm a newbie!!!)
That's why I didn't know what to do after I put the buttons in the email, but I'm sure I'll figure it out soon.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -4. The time now is 5:11 PM.

Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0


For advertising opportunities click here.